|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Joystick Trigger Programming
I am using WindRiver and all of the posts for the trigger programming are for LabVIEW. Could anyone help me with the programming of the buttons on the joysticks in WindRiver? Thanks a lot.
|
|
#2
|
|||
|
|||
|
Re: Joystick Trigger Programming
If anyone knowns how to program limit switches that would be helpful as well. Thanks again.
|
|
#3
|
||||
|
||||
|
Re: Joystick Trigger Programming
Joystick stick(1);//channel 1
if (stick.GetRawButton(1-11))//1 is the trigger button, 2-11 the buttons labled as such { ... } DigitalInput di(1);//channel 1 if (di->Get()) { ... } |
|
#4
|
|||
|
|||
|
Re: Joystick Trigger Programming
Is there not a GetTrigger function in Joystick.h?
I don't have the header files here, but i think there is one. (you can check) EDIT: in Joystick.h, there is a GetTrigger function, as well as just the normal numbered 1-11 buttons Code:
virtual bool GetTrigger(JoystickHand hand = kRightHand); bool GetRawButton(UINT32 button); Byteit is good on the limit switch too,I think not sure, that the Jaguars also have built in limit switch support, no code required Last edited by bwobo : 02-07-2009 at 09:00 PM. |
|
#5
|
|||
|
|||
|
Re: Joystick Trigger Programming
Thank you all
|
|
#6
|
|||||
|
|||||
|
Re: Joystick Trigger Programming
...which the 2009 rules do not permit using, alas.
|
|
#7
|
|||
|
|||
|
Re: Joystick Trigger Programming
You could use the GetTrigger function or use Button1 if you're using the standard joystick...
|
|
#8
|
|||
|
|||
|
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
}
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 : 02-09-2009 at 07:29 PM. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Programming the joystick trigger... | pudgeball | C/C++ | 4 | 01-10-2009 10:25 AM |
| Joystick Programming | greatman05 | Programming | 11 | 01-30-2008 08:40 PM |
| Joystick Programming | LieAfterLie | Programming | 7 | 02-15-2007 09:30 AM |
| Programming a Joystick | sbf2009 | Programming | 3 | 02-10-2007 03:59 PM |
| Joystick Programming | team 803 | Programming | 6 | 02-21-2006 11:49 AM |