|
What button is what on your gamepad(s)? |
amber
Member #6,783
January 2006
|
I am making a game that uses a gamepad for input so I'd like to get an idea of what button number in Allegro (e.g., 0, 1, 2, etc.) maps to what physical button (e.g., A, B, X, triangle, etc.) on various gamepads. So, I would appreciate it if anyone who uses a gamepad with Allegro wouldn't mind posting what button maps to what physical button on your gamepad. For example, something like "on my Super NES controller that I somehow managed to plug into my PC button 0 is B, button 1 is Y, button 2 is X ..." and so on. My PS1 controller with a USB adapter uses the scheme I find this scheme to be a little strange because I'd usually think of X (or A on an xbox controller) to be the "first" button, but this could just be my impression clashing with how things work internally... hence my curiosity about how the numbers work for other people's devices. If your controller is not (or doesn't resemble) something used on a popular console, a link to a picture would also be appreciated. Thank you. |
l j
Member #10,584
January 2009
|
Wow I edit too much Logitech F510 Rumble(Supports 2 different input modes) Button 0 = X (Square on PS controller) I've quickly tested this with the Allegro ex_joystick_events example, I think those little squares are in an ascending sequence. I'll put what happens when I use XInput later, still have stuff to do.
|
amber
Member #6,783
January 2006
|
This is informative, particularly the part about other gamepads also corresponding to this pattern. Perhaps I'm right that my gamepad's layout is rather odd, but wrong that A is the "first" button, and what you have here is more of a "standard" arrangement, at least when using DirectInput. I don't use XInput at all, so no need to post information on that for my sake, if you're busy. Thank you for the response! |
MiquelFire
Member #3,110
January 2003
|
I have to wait until I get home to verify this, but the 360 controller might have A as button 0. I do know, however, that with DirectInput, what would be l2 and r2 are on a single axis (so holding both down at once is the same as not holding them down) --- |
Oscar Giner
Member #2,207
April 2002
|
With Rumble Gamepad F510 working in XInput mode (should be the same as an XBOX360 controller): Button 0 = A LT and RT are mapped to an axis. -- |
amber
Member #6,783
January 2006
|
That Xbox layout is closer to what I expected. Thanks. |
MiquelFire
Member #3,110
January 2003
|
Oscar, if you were using XInput mode, LT and RT would each be on their own axis, not shared. Just an FYI. --- |
Trent Gamblin
Member #261
April 2000
|
Allegro 5 uses DirectInput for joystick handling on Windows. In ex_joystick_events, I get two separate axes for LT and RT or I'm a monkey's uncle. I didn't try it right now, but I will on a $50+ bet.
|
amber
Member #6,783
January 2006
|
According to MSDN, DirectInput puts LT and RT on a shared axis. Quote: The combination of the left and right triggers in DirectInput is by design. Games have always assumed that DirectInput device axes are centered when there is no user interaction with the device. However, the Xbox 360 controller was designed to register minimum value, not center, when the triggers are not being held. Older games would therefore assume user interaction. The solution was to combine the triggers, setting one trigger to a positive direction and the other to a negative direction, so no user interaction is indicative to DirectInput of the 'control' being at center. (From http://msdn.microsoft.com/en-us/library/ee417014%28v=vs.85%29.aspx ) I don't know if Allegro 5 does something to the input, though. |
MiquelFire
Member #3,110
January 2003
|
For me, it's on the same axis. Allegro5 was my first exposure to this behavior actually. --- |
Trent Gamblin
Member #261
April 2000
|
Well then thanks for not taking that bet because I'm probably wrong .
|
Ben Delacob
Member #6,141
August 2005
|
Wii Classic controller connected with MayFlash adapter: Button 0 = a __________________________________ |
Sirocco
Member #88
April 2000
|
Gamecube controller via USB adapter: 0 - A --> |
|