On ps3 button controller being pushed, do...

Hello I'm working on a RC car using an arduino usb shield, ps3 controller and a simple usb bluetooth dongle. I'm trying to make the servo motor runs while pressing the "R1" key, but I don't find a confortable function that allows me to to such thing. I just got similar examples, just like this one:

   if(PS3.PS3Connected || PS3.PS3NavigationConnected)

{

if(PS3.getButtonClick(TRIANGLE)==HIGH)

 {

for(int pos = 0; pos < 180; pos++)

{

servo1.write(pos);

delay(5); // Give the servo time to move

 }

  }

else if(PS3.getButtonClick(CROSS)==HIGH)

{

 for(int pos = 1800; pos >= 0; pos--)

  {

servo1.write(pos);

delay(5); // Give the servo time to move

}

 }

 }

I guess that this function is the one that alows me to move the servo:

if(PS3.getButtonClick(R1)==HIGH)

But how can I make like if I'm holding the button, the servo will be moving and if I just left it, it will stop.

Someone please give me atleast one example of what should I do, I'm newbie on such topics and programming, any help can be really useful.

Thanks.

Any answer?

int pos = 0;
int oldPos = pos;

void loop(){
  if(PS3.getButtonClick(L1)==HIGH){
    pos++;
    if(pos > 180)
      pos = 180;
  }
  if(PS3.getButtonClick(R1)==HIGH){
    pos--;
    if(pos < 0)
      pos = 0;
  }
  if(pos != oldPos){ //this way we aren't writing the same data to the servo every 5ms
    servo1.write(pos);
    oldPos = pos;
  }
  delay(5);
}

PS: the way you format your code is disgusting, why all the spaces in-between and indenting the lines!