2

I've got Microsoft Sculpt Ergonomic Desktop (keyboard + mouse) and it creates major problems in some games with gamepad support as the nonexistent virtual joystick drives the input crazy. If I run rmmod joydev the problem is solved, but I've got real gamepad and driving wheel and I want to use them as input controllers in games. So how can I disable only the virtual Sculpt joystick without killing game controller support?

$ udevadm info /dev/input/js0

$ udevadm info --attribute-walk /dev/input/js0

http://i.imgur.com/sAiQXAR.png - jstest-gtk screenshot
1

The temporary brute force solution is to just rename/delete the device files, i.e.:

rm /dev/input/js0
mv /dev/input/js1 /dev/input/js0

Note however most modern games do not use the /dev/input/js0 interface at all, so you will need to take care of the /dev/input/eventX files as well. You can use evtest to find out which device is your keyboard and joystick. On the next reboot the devices will be back in their old order.

Another slightly less brute force method is via the environment variable:

SDL_JOYSTICK_DEVICE="/dev/input/js1"
export SDL_JOYSTICK_DEVICE

This forces SDL based games to use js1 instead of js0. I don't think this will work with modern SDL2 based games and it will only work for a single joystick/gamepad, so it's of limited use.

SDL2 does provide an option to configure a joystick and remap buttons, but I don't think it has a facility to reorder devices at the moment.

And finally there is also the "clean" method by writing an udev rule, this will essentially do the same as the rm/mv hack, but permanently. These rules go to /etc/udev/rules.d/ and tutorials for writing them can be found scattered around the net, maybe this will help, not sure if it's up to date:

http://www.reactivated.net/writing_udev_rules.html

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.