View Single Post
  #8   Spotlight this post!  
Unread 09-02-2009, 19:27
csshakka csshakka is offline
Registered User
FRC #0818
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Warren, MI
Posts: 21
csshakka is an unknown quantity at this point
Send a message via AIM to csshakka Send a message via MSN to csshakka
Re: Joystick Trigger Programming

You can use the GetTrigger() function. Something like this:
Code:
Joystick *stick;
stick = new Joystick(1);

if (stick->GetTrigger())
{
    // Code if trigger is held
}
else
{
    // Code if trigger is released
}
Buttons are similar, but you use the GetRawButton() command.

Code:
Joystick *stick;
stick = new Joystick(1);

if (stick->GetRawButton(1-11))
{
    // Code if button is held
}
else if (!stick->GetRawButton(1-11))
{
    // Code if button is released
}

Last edited by csshakka : 09-02-2009 at 19:29.
Reply With Quote