I recently got a wired (USB) XBox 360 gamepad. It was nearly plug-and-play on my laptop running Ubuntu 12.04. However, some control axes were mixed up. I used jstest-gtk to reconfigure the mapping and jscal-store to (supposedly) save the new configuration. However, when I run Xonotic or Nexuiz (First Person Shooters), they still uses the original mixed-up mapping. How do I make these games recognize the new configuration? BTW, I'm more concerned about Xonotic working, I really couldn't care less about Nexuiz. Please no rants about why I should stick with a mouse and keyboard for gaming. [:-) Thanks in advance.
The problem is that jstest-gtk only changes the mapping of the joystick device, i.e.
/dev/input/js0. Most modern games that use SDL however do no longer use the joystick device, but use the raw evdev instead, i.e. /dev/input/eventX and that doesn't allow any remapping.
The quickest workaround is setting an environment variable:
This will force SDL based applications to use the old joystick device and thus respect the mapping. It won't help with non-SDL applications.
Another alternative is xboxdrv, it's a userspace Xbox360 driver that allows a wide variety of configuration options at the driver level (including keyboard andd mouse emulation). This will work for all games.
In Xonotic's advanced settings, there are two variables:
joy_axisyaw which must be changed. Unfortunately, Xonotic resets them to default when you close the game. What I did to fix this was in the directory
/home/username/.xonotic/data I added a file which I called "config-mods.cfg". In this file are two lines:
Finally I made a simple shell script with these two lines of code:
cat /home/username/.xonotic/data/config-mods.cfg >> /home/username/.xonotic/data/config.cfg
/home/username/Applications/Xonotic/xonotic-linux64-sdl -basedir /home/username/Applications/Xonotic/`
I run this script instead of running the game directly, and it adds the two lines I need for joystick support.