Page 1 of 1

Gamepad: joystick's button press doesn't register

Posted: Sun Jul 31, 2005 2:26 am
by Workaphobia
I have a logitech dual action gamepad, and I'm wondering why every normal button can be assigned to a command via the input menu or the configuration file, but not the signal generated when I press either of the joysticks in (I'm not talking about the axes, but the "click"). Kcontrol recognizes these as digital inputs 11 and 12, and does not appear to distinguish them from the other buttons in any way.

When I try to add a bind statement to the configuration file containing "Joystick Button 11", I find that bzflag erases it, but it lets it stay if I use a lower button number.

Posted: Sun Jul 31, 2005 6:34 pm
by Workaphobia
Wow. I just did something I've never done before: I took a serious look at the insides of bzflag. While searching for an unrelated part of bz code, I stumbled upon ./src/common/KeyManager.cxx, where I saw that the array

Code: Select all

const char* KeyManager::buttonNames[] = { ...
does not contain definitions beyond button ten. A couple of couts in ./src/platform/SDLJoystick.cxx showed me that SDL itself has no problem recognizing all 12 buttons.


Do I need to go through any special channels to ask one of the devs to add in the extra two definitions? In any case, I'm going to experiment with it myself for a bit.

[edit]
Solved! I changed the following:
./include/BzfEvent.h, around line 128: added "BZ_Button_11, BZ_Button_12,"
./src/common/KeyManager.cxx, around line 104: added ""Joystick Button" 11", "Joystick Button 12"",
./src/bzflag/playing.cxx, around line 5761 (that's one huge file): added "BzfKeyEvent::BZ_Button_11, BzfKeyEvent::BZ_Button_12"

Of course, I'm sure anyone with any trivial experience with the source will think this is all obvious. :)

Posted: Tue Jul 11, 2006 11:23 am
by Skeeve
Thanks! That helped me a lot!

Now all I'm missing is the "Hatswitch". I bought a Thrustmaster FireStorm Dual Analog 3 just yesterday and it has a nice D-Pad which is identified by "Joystick Tester" as a "Hatswitch".

Wouldn't it be greate one could use these 4-8 additional buttons too?

Re: Gamepad: joystick's button press doesn't register

Posted: Wed Mar 07, 2012 12:15 am
by khonkhortisan
I submitted patch #3498089 in Workaphobia's honor: https://sourceforge.net/tracker/?func=d ... tid=303248