Servo Movement only when holding down button on IR remote

Hey everyone!
I’ve got a quick question regarding a servo…

Right now, I have some code setup to turn a servo when I push a button on my IR remote (very simple IR remote). However, when I push it it continuously moves until it hits the limit and I hit another button sending it in the opposite direction. What I would like to do is make the servo turn ONLY when I am pressing the button down. How would I approach something like this?

Thank you

Here is a copy of my code!

#include <IRremote.h>      
#include <Servo.h>
#define plus 0xA3C8EDDB   //clockwise rotation button
#define minus 0xF076C13B  //counter clockwise rotation button
#define terminate 0xE5CFBD7F
 //stop


int RECV_PIN = 2;       //IR receiver pin
Servo servo;
int val;                //rotation angle
bool cwRotation, ccwRotation;  //the states of rotation

IRrecv irrecv(RECV_PIN);

decode_results results;

void setup()
{
  Serial.begin(9600);
  irrecv.enableIRIn(); // Start the receiver
  servo.attach(9);     //servo pin
}

void loop() 
{
  if (irrecv.decode(&results)) {
    Serial.println(results.value, HEX);
    irrecv.resume(); // Receive the next value

    if (results.value == plus)
    {
      cwRotation = !cwRotation;      //toggle the rotation value
      ccwRotation = false;         //no rotation in this direction
    }

    if (results.value == minus)
    {
      ccwRotation = !ccwRotation;   //toggle the rotation value
      cwRotation = false;            //no rotation in this direction
    }
    if (results.value == terminate)
    {
      ccwRotation = false;   //toggle the rotation value
      cwRotation = false;            //no rotation in this direction
    }
  }
  if (cwRotation && (val != 175))  {
    val++;                         //for clockwise button
  }
  if (ccwRotation && (val != 0))  {
    val--;                         //for counter clockwise button
  }
  servo.write(val);
  delay(5);          //General speed
}

At the moment your code sets values when it receives something but it does nothing when it does not receive something.

It may be sufficient to add these lines at the end

  servo.write(val);
  delay(5);          //General speed
  ccwRotation = false;  // <--- NEW  stop the servos when the move completes
  cwRotation = false;

You might want to increase the delay() a little

…R