Difference between revisions of "Talk:Manual:Config:Advanced:Bindings:Joystick"
(SideWinder (and other) joysticks under Linux) |
(Stuck a header in.) |
||
Line 1: | Line 1: | ||
+ | ==SideWinder (and other) joysticks under Linux== | ||
Regarding the comment about the bindings not working in Linux: One thing to keep in mind is that the Linux joystick drivers (particularly my USB-based one) can receive inputs in the weirdest ways. | Regarding the comment about the bindings not working in Linux: One thing to keep in mind is that the Linux joystick drivers (particularly my USB-based one) can receive inputs in the weirdest ways. | ||
Revision as of 21:28, 30 July 2005
SideWinder (and other) joysticks under Linux
Regarding the comment about the bindings not working in Linux: One thing to keep in mind is that the Linux joystick drivers (particularly my USB-based one) can receive inputs in the weirdest ways.
For example, on my joystick, I've got standard movement, twist action, a throttle, a digital hatswitch, and eight buttons: one trigger, three thumb buttons, four base buttons. But Linux sees my joystick as having 11(!) axes and 20(!!) buttons. So things are mapped a little differently.
On mine, for example, axes 0 and 1 are the left-right and up-down respectively (normal). Axis 4 is the left-right twist action, not 2 or 3 as you would expect. Axis 5 is the throttle. And even though the hatswitch is digital, axes 6 and 7 are the hat left-right and up-down, respectively — but they're always either -1, 0, or +1. The rest seem to be unused.
As for buttons, things are a little more normal: Buttons 0 through 7 are directly mapped to the trigger through button 8 on the joystick. Rather cute, however, is the pseudo button 11, which is "pressed" when the infrared sensor detects the hand leaving the joystick. I could see some fun with this, like making it a jump, dock, or pause button. :)
What you need to map stuff properly is to get the program 'jstest', available (at least in Debian) as part of the 'joystick' package. Locate your joystick device (/dev/input/js* or /dev/js*) and run jstest on it, then frob some of the controls around. Things should become apparent quite quickly, and you may find some cool stuff (like my hand sensor).