Trouble getting the joypad buttons
Hi,
Â
I told a few days ago on IRC that I have a problem with a Saitek joypad. This joypad sends useless information on each press so it fills the input dialog with the same thing even if I press different buttons.
Â
As you can see here (from SDL/test source directory) a joystick tester that prints every button information from a joystick, that what happening when I press two buttons :
Â
Code: Select all
markand@Melon ~ $ sdl-joytest -
There are 1 joysticks attached
Joystick 0: 0x0004 (0)
axes: 4
balls: 0
hats: 1
buttons: 12
Watching joystick 0: (Joystick (0))
Joystick has 4 axes, 1 hats, 0 balls, and 12 buttons
Joystick 0 hat 0 value: centered
Joystick 0 button 3 down
Joystick 0 hat 0 value: centered
Joystick 0 button 3 up
Joystick 0 hat 0 value: centered
Joystick 0 button 2 down
Joystick 0 hat 0 value: centered
Joystick 0 button 2 up
Â
We can see the hat 0 value that may cause de problem, so when I try to fill the dialog input it does the following :
Â
I put the focus on the first entry (Up) and I press one button, as you can see it fill two inputs directly with the same value.
Â
Screenshot of input dialog: http://files.malikania.fr/dialog.png
Â
The button pressed was one of the four at right: http://i2.cdiscount.com/pdt/P/2/1/1/f/PP21.jpg
Â
If you have any clue to fix that.. My knowledge in SDL are not enough to fix it right now.
Â
Note: this bug does not appears with zsnes, snes9x-gtk and other SDL joystick capable application.