Go to Post Embrace the challenge, dont shoot it down. - waialua359 [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #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
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Programming the joystick trigger... pudgeball C/C++ 4 10-01-2009 10:25
Joystick Programming greatman05 Programming 11 30-01-2008 20:40
Joystick Programming LieAfterLie Programming 7 15-02-2007 09:30
Programming a Joystick sbf2009 Programming 3 10-02-2007 15:59
Joystick Programming team 803 Programming 6 21-02-2006 11:49


All times are GMT -5. The time now is 13:16.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi