How to make Steam recognize your gamepad in Linux
Just a little something I found.
I have a cheap chinese PS3 gamepad (“SZMY-POWER CO.,LTD. GAMEPAD 3 TURBO”, not that it would say much though), which is properly recognized by the system, but not Steam. It turned out, the problem is with the device’s permissions. For some unknown reason Steam and some games require joystick device to be world-writable. Pretty dumb, since there’s only need to read what it does, not to tell it what to do. But anyway, the solution is simple. You need to do something like
# chmod +w /dev/input/js0 /dev/input/event16
Make sure these devices correspond your gamepad. Yes, you need both js* and event* devices.
Now, that would be a pretty annoying thing to do every time you want to play with gamepad. There’s udev
for this, and it’s used by all modern systems (seriously, I haven’t heard of a distro that would still use hal
). So you need to create a rules file (e. g. /etc/udev/rules.d/99-gamepad-permission-fix.rules
) with the following content:
KERNEL=="js*", SUBSYSTEM=="input", ENV{ID_VENDOR_ID}=="0e8f", ENV{ID_MODEL_ID}=="310d", MODE="0666"
KERNEL=="event*", SUBSYSTEM=="input", ENV{ID_VENDOR_ID}=="0e8f", ENV{ID_MODEL_ID}=="310d", MODE="0666"
You can see your gamepad’s vendor ID and model ID in dmesg
or lsusb
. If you don’t want to reboot, issue this command
# udevadm control --reload-rules
and re-plug your gamepad. Now it should be recognized by the Steam’s Big Picture Mode and some games, like “You Have to Win the Game”.