Go to Post Every event that starts with "a little bit of fun" has the potential to end in disaster. Please think about all possible outcomes before you do anything stupid. - sanddrag [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

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 02-09-2009, 07:27 PM
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 : 02-09-2009 at 07:29 PM.
Reply With Quote
Reply


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 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


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

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