With Steam recently coming to Linux, and all the great humble bundles, it’s becoming more and more important to have a good gamepad to use on your Linux PC. If you’re a console gamer, you probably already have an XBox 360 or a PS3 controller. In fact, plug in your controller via USB and it probably already works. Unfortunately, many games (Hotline Miami, Super Meat Boy, etc.) assume you have a 360 controller and the button mappings of a PS3 dualshock controller will be horribly skewed (the PS3 select button is 360′s A button). In some games, like Cave Story+, this is not a problem because they allow custom key mappings within the program. A few, like Steam Big Picture, correctly detect the PS3 controller. However, many games just assume a 360 controller, so it simplifies things if you make the dualshock pretend to be a 360 controller. Luckily, there’s a program that does just this: xboxdrv.
- Install the
xboxdrvpackage. Or get it from the source.
sudo apt-get install xboxdrv
- Plug in your PS3 DualShock controller via USB. The LEDs will flash. You should see relevant lines in your
/var/log/syslogfile (or equivalent, depending on your distribution – I’m using Ubuntu 13.04).
usb 4-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
usb 4-2: Product: PLAYSTATION(R)3 Controller
usb 4-2: Manufacturer: Sony
sony 0003:054C:0268.0008: Fixing up Sony Sixaxis report descriptor
input: Sony PLAYSTATION(R)3 Controller as /devices/pci0000:00/0000:00:13.2/usb4/4-2/4-2:1.0/input/input18
sony 0003:054C:0268.0008: input,hiddev0,hidraw0: USB HID v1.11 Joystick [Sony PLAYSTATION(R)3 Controller] on usb-0000:00:13.2-2/input0
- Press the PlayStation button to enable it. The LEDs will continue to flash, but input will now register.
- Run xboxdrv.
sudo xboxdrv --detach-kernel-driver
You may require one or both of “sudo” and “–detach-kernel-driver” above. If you get a LIBUSB_ERROR_ACCESS error, you’ll have to use sudo. If you get a LIBUSB_ERROR_ACCESS error, you can try the –detach-kernel-driver option.
- Play a game!