I'm not positive what you're asking, but I think you want this:
Code:
if( joyStick.GetRawButton( 2 ) ) {
motorSpeedController.Set( 1.0f ); // where motorSpeedController is either a Victor or Jaguar, run it at full forward
} else {
motorSpeedController.Set( 0.0f ); // stop the motor when button two isn't pressed
}