Difference between revisions of "Linux Joysticks and Gamepads"

From Elite Wiki
m
m
Line 3: Line 3:
 
Linux distributions such as Ubuntu Lucid have many joystick and gamepad drivers built in. While they work out of the box, they offer limited configurability. Here I will outline a better alternative which works irrespective of whether your Linux distribution includes joystick support.<br><br>
 
Linux distributions such as Ubuntu Lucid have many joystick and gamepad drivers built in. While they work out of the box, they offer limited configurability. Here I will outline a better alternative which works irrespective of whether your Linux distribution includes joystick support.<br><br>
  
This describes how to set up a userspace driver called xboxdrv for use with an XBox 360 controller. The author of xboxdrv has extended it to also work with non-XBox controllers, so if anyone tries this and gets it to work, please expand this wiki page. (xboxdrv author wrote: support for reading from evdev, this allows the use of regular regular PC joysticks or the Playstation 3 controllers with xboxdrv, useful if you need configurability or joy2key-like functionality, but don't have a Xbox360 gamepad.)
+
This describes how to set up a userspace driver called xboxdrv for use with an XBox 360 controller. The author of xboxdrv has extended it to also work with non-XBox controllers, so if anyone tries this and gets it to work, please expand this wiki page. (xboxdrv author wrote: support for reading from evdev, this allows the use of regular PC joysticks or the Playstation 3 controllers with xboxdrv, useful if you need configurability or joy2key-like functionality, but don't have a Xbox360 gamepad.)
  
 
1. Install [[http://pingus.seul.org/~grumbel/xboxdrv/ XBoxDrv]] - for Ubuntu there is a binary package. Installation instructions are [[http://github.com/Grumbel/xboxdrv/blob/master/README here]].<br><br>
 
1. Install [[http://pingus.seul.org/~grumbel/xboxdrv/ XBoxDrv]] - for Ubuntu there is a binary package. Installation instructions are [[http://github.com/Grumbel/xboxdrv/blob/master/README here]].<br><br>

Revision as of 19:21, 11 January 2011

Setting up a Joystick or Gamepad in Oolite under Linux

Linux distributions such as Ubuntu Lucid have many joystick and gamepad drivers built in. While they work out of the box, they offer limited configurability. Here I will outline a better alternative which works irrespective of whether your Linux distribution includes joystick support.

This describes how to set up a userspace driver called xboxdrv for use with an XBox 360 controller. The author of xboxdrv has extended it to also work with non-XBox controllers, so if anyone tries this and gets it to work, please expand this wiki page. (xboxdrv author wrote: support for reading from evdev, this allows the use of regular PC joysticks or the Playstation 3 controllers with xboxdrv, useful if you need configurability or joy2key-like functionality, but don't have a Xbox360 gamepad.)

1. Install [XBoxDrv] - for Ubuntu there is a binary package. Installation instructions are [here].

2. Don't worry about all the stuff about sudo modprobe uinput and changing permissions on /dev/uinput etc.

3. Download [runxboxdrv] a wrapper I wrote to make using xboxdrv very simple. Hopefully, this will be included in a future release of XBoxDrv.

4. Also in the download are an Oolite configuration for xboxdrv: oolite.ini and a key configuration for Oolite to go with it: keyconfig.plist

5. Extract them to your home folder and move keyconfig.plist to ~/.Oolite/Addons

6. Make runxboxdrv executable eg. chmod +x ~/runxboxdrv

7. Run from a menu icon or shell using: ~/runxboxdrv --config=~/oolite.ini /usr/bin/oolite

8. The only joystick setup needed in Oolite is to set up the axes. The left hand analog stick left-right should be roll. The right hand stick is up, down, left, right.

9. Open oolite.ini in a text editor to see the mappings of everything else. Descriptions of the option names can be found at [xboxdrv manpage]

10. The left shoulder button acts like a shift key and effectively almost doubles the number of buttons.

If you have any problems, post on the [Forums].