View Single Post
  #2   Spotlight this post!  
Unread 10-01-2009, 10:25
pudgeball pudgeball is offline
Registered User
AKA: Nick McGuire
FRC #2386 (BCHS Trojan Robotics)
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2008
Location: Ontario
Posts: 13
pudgeball is an unknown quantity at this point
Re: Programming the joystick trigger...

Quote:
Originally Posted by JDM View Post
There's a function of the Joystick class called "GetTrigger".

So, the code that you would want to use would be something like the following, where m_Stick is the name of the Joystick object that you want to check.

Code:
if (m_Stick->GetTrigger()) {
 ...
}
I hope this helps.

The one thing I find when we try to use '->' is that I get an error; "error: base operand of `->' has non-pointer type `Joystick'". So my around that error was/is;

Code:
if (m_Stick.GetTrigger()) {
...
}
I finally did get the code to work. With that fix mentioned above. But thank you for your help.
Reply With Quote