Problem with joystick detection
by Rob Segal · in Torque Game Builder · 05/09/2006 (11:24 pm) · 8 replies
Anyone else have problem with joystick button press detection. I can't get anything to happen here and am wondering why. I've created a new action map and inject commands as....
I've also tried entering commands into the global action map as...
I'm running out of ideas here! It just don't make no sesnse. Any thoughts on this? Any help is much appreciated.
moveMap.bind(joystick0, button0, joystickClick);
I've also tried entering commands into the global action map as...
GlobalActionMap.bind(joystick, button1, joystickClick);
I'm running out of ideas here! It just don't make no sesnse. Any thoughts on this? Any help is much appreciated.
#2
GlobalActionMap.bindCmd("joystick0", "button0", "b0down();", "b0up();");
Can you see the joystick in your control panel and have you added these lines of code in your script:
$enableDirectInput = "1";
activateDirectInput();
Good luck!
05/10/2006 (12:45 am)
Also, have you tried:GlobalActionMap.bindCmd("joystick0", "button0", "b0down();", "b0up();");
Can you see the joystick in your control panel and have you added these lines of code in your script:
$enableDirectInput = "1";
activateDirectInput();
Good luck!
#3
05/10/2006 (8:28 am)
I have moveMap.push() and indeed that does work because I can get some keys on the keyboard to work. I have tried joystick0 instead of joystick however unless the TGB editor sets up the code you cited implicitly...$enableDirectInput = "1"; activateDirectInput();I definitely do not have it in there. I'll give that a try later tonight. Thanks for the suggestions Jason.
#4
05/10/2006 (11:19 pm)
The saga continues. Still can't get this to work. Would it make a big difference if I am using a PS1 controller hooked up through a USB adapter? It does get detected by Windows properly and I do see joystick0 was detected on TGB startup. It's just gotta work... it's just gotta! Sorry the stress is getting to me.
#5
05/11/2006 (12:05 am)
Did you try enableJoystick() ?
#6
05/11/2006 (12:05 am)
Here. Try my patched version of TGB that have better game controller support. Here is the thread: http://www.garagegames.com/mg/forums/result.thread.php?qt=36789. At the very bottom is the Beta 3 TGB that's been patched to input my DInput and XInput updates. Give that a whirl.
#7
I'll check that one out when I get home tonight. I kind of thought would be implicitly take care of by the TGB framework setup for each project but perhap I am just naive. Thanks for the suggestion Sebastien, will update you with the results.
@Jason - Yeh I saw that thread. I shall indeed give that a whirl and let you know the results Jason. Thanks.
05/11/2006 (10:12 am)
Quote:Did you try enableJoystick() ?
I'll check that one out when I get home tonight. I kind of thought would be implicitly take care of by the TGB framework setup for each project but perhap I am just naive. Thanks for the suggestion Sebastien, will update you with the results.
@Jason - Yeh I saw that thread. I shall indeed give that a whirl and let you know the results Jason. Thanks.
#8
Success! Finally I have broken through! It took the above code to get my joystick to work. Who would have thought it would be so much work just to get my joystick to work. Jason and Sebastien I think you both as it took a combination of your efforts to come to this conclusion. It is greatly appreciated.
05/11/2006 (8:42 pm)
$enableDirectInput = "1"; activateDirectInput(); enableJoystick();
Success! Finally I have broken through! It took the above code to get my joystick to work. Who would have thought it would be so much work just to get my joystick to work. Jason and Sebastien I think you both as it took a combination of your efforts to come to this conclusion. It is greatly appreciated.
Torque Owner Jason Cahill
Default Studio Name
code snippet 1: did you remember to moveMap.push(); to set it active?
code snippet 2: try "joystick0" instead of "joystick"