I’m having some trouble using jinput with my wireless xbox 360 gamepad on linux. I did some digging into the source and found a couple of problems.
- The linux plugin NativeDefinitions file says that it’s generated from /usr/include/linux/input.h, but hasn’t changed in svn in 7 years. A quick comparison against my actual input.h from kernel 3.5.0 shows a lot of differences. Specifically, what’s really tripping me up is that it’s missing the button codes in the 0x200 range. My gamepad, for instance, is generating codes in this range for the d-pad.
- Related to the previous point is that the LinuxNativeTypesMap is also out-of-date. For instance, there doesn’t appear to be an entry for BTN_START, causing the “start” button on my gamepad to show up as an “unknown” button.
- Finally, in LinuxNativeTyepsMap.getButtonID, the code is creating a Key.UNKNOWN object instead of a Button.UNKNOWN object when the native button id isn’t recognized. I’m using jMonkeyEngine, which expects a joystick to only have buttons and axes, so even though jinput is reporting 5 “unknown” components, jME is throwing them away because they’re keys. This might be something to fix in jME but I also believe that returning a key from getButtonID is a defect.
I’d love to get these problems fixed to support the linux gaming community (and my project ;D ). I’m looking for some help here to either have the library updated or, alternatively, get some assistance with building the project so I can fix it myself and submit a patch. Can anyone offer advice?