Making Particles play and stop on move inputs

What I have right now is a movement system based off of the positive and negative inputs from

float moveX = Input.GetAxisRaw("Horizontal");
float moveY = Input.GetAxisRaw("Vertical");

I’m extremely new to unity and I’m trying to get a Particle System to play when an input is pressed. I plan on having empty game objects with the thruster Particle System parented to whatever side the thrusters are on. For example if the "Horizontal" Input was +1 it would play the BottomThruster Particle System in that empty game object that I’ve called BottomThrusterPos.

Right now all I have is:

 void Start()
 {
     BottomThruster = GetComponentInChildren<ParticleSystem>();
 }

 void Update()
 {
     ProcessInputs();
     if (Input.GetKeyDown(KeyCode.W))
     {
         BottomThruster.Play();  
     }
}

It plays the Particle System and does not stop and I have no idea how to detect when a key is unpressed or to tell the Particle System to stop playing.

If you want to use the same logic that you’re using now, make this simple modification:

 void Start()
 {
     BottomThruster = GetComponentInChildren<ParticleSystem>();
 }

 void Update()
 {
     ProcessInputs();
     if (Input.GetKeyDown(KeyCode.W))
     {
         BottomThruster.Play();  
     }
     else
     {
         BottomThruster.Pause();
     }
}

You could also use Input.GetKeyUp(KeyCode.W) to call the Pause() Like this:

 void Start()
 {
     BottomThruster = GetComponentInChildren<ParticleSystem>();
 }

 void Update()
 {
     ProcessInputs();
     if (Input.GetKeyDown(KeyCode.W))
     {
         BottomThruster.Play();  
     }
     else if (Input.GetKeyUp(Keycode.W))
     {
         BottomThruster.Pause();
     }
}

For future reference, you can use the Unity Documentation website to locate any information on built in components. For example, here is the page for Particle System. Under Public Methods you can see it lists both a Stop() and Pause() method. And here is the page for Input that shows the GetKeyUp() method.

Thank you so much BranlyBran. I knew what I wanted to do I just haven’t learned all the words to do it yet. This will definitely help me with future code too. It works not for the most part. However I do want the particles to continue playing I just want them to stop emitting at this point.