Difference between revisions of "Linux Joysticks and Gamepads"

From Elite Wiki
Line 1: Line 1:
== Setting up the XBox 360 Controller in Oolite under Linux ==
+
== Setting up a Joystick or Gamepad in Oolite under Linux ==
  +
[ EDIT: The author of xboxdrv has updated it to also work with non-XBox controllers and to directly accept an INI configuration file. It should be possible to alter oolite.cfg to this INI format. If anyone does this before I get round to it, please post on the [[http://www.aegidian.org/bb/viewforum.php?f=3 Forums]]. ]
  +
 
Linux distributions such as Ubuntu Lucid have the xpad kernel driver built in. While this works out of the box, this offers limited configurability. Here I will outline a better alternative which works irrespective of whether your Linux distribution includes xpad support.<br><br>
 
Linux distributions such as Ubuntu Lucid have the xpad kernel driver built in. While this works out of the box, this offers limited configurability. Here I will outline a better alternative which works irrespective of whether your Linux distribution includes xpad support.<br><br>
   
Line 14: Line 14:
   
 
If you have any problems, post on the [[http://www.aegidian.org/bb/viewforum.php?f=3 Forums]].
 
If you have any problems, post on the [[http://www.aegidian.org/bb/viewforum.php?f=3 Forums]].
 
[ EDIT: The author of xboxdrv has updated it to directly accept an INI configuration file. It should be possible to alter oolite.cfg to this INI format. If anyone does this before I get round to it, please post on the [[http://www.aegidian.org/bb/viewforum.php?f=3 Forums]]. ]
 
   
 
[[Category:Oolite]]
 
[[Category:Oolite]]

Revision as of 10:29, 2 January 2011

Setting up a Joystick or Gamepad in Oolite under Linux

[ EDIT: The author of xboxdrv has updated it to also work with non-XBox controllers and to directly accept an INI configuration file. It should be possible to alter oolite.cfg to this INI format. If anyone does this before I get round to it, please post on the [Forums]. ]

Linux distributions such as Ubuntu Lucid have the xpad kernel driver built in. While this works out of the box, this offers limited configurability. Here I will outline a better alternative which works irrespective of whether your Linux distribution includes xpad support.

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.cfg 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 --cfg ~/oolite.cfg /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.cfg in a text editor to see the mappings of everything else. The option names correspond to those at [xboxdrv manpage] but without the "--"

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].