How do I configure a joystick or gamepad?

I recently received a Logitech Rumblepad 2 (a joystick, like a PS2 controller) from a friend.

How would I configure this in Ubuntu? If possible, I would prefer to use a GUI utility.

I tried jstest-gui, but it shows my accelerometer!


Solution 1:

This process will work for Ubuntu 11.04 (Natty) and older versions. For the newest versions please refer to this Answer by RolandiXor. Thank you.

Not tested by me, but found in a link provided at: http://ubuntuforums.org/showthread.php?t=393425, I hope this may help.

Install joystick and jscalbrator

sudo apt install joystick jscalibrator

then run the calibration processes

jscal -c /dev/input/js0 (this is my joystick location, check yours)

jstest /dev/input/js0 (or wherever) If I remember correctly, this should return 0 for no error.

run jscalibrator

jscalibrator

and it should recognize the type of gamepad correctly and recognize all of your buttons, and axis

enter image description here

enter image description here

There is also an application called jstest-gtk, which seems to do something like that, I post here a screenshot and the link for you: https://github.com/Grumbel/jstest-gtk (This software may need to be compiled in order to make it work)

enter image description here

Solution 2:

It is possible to calibrate Joysticks in Kubuntu using KDE's system settings. This is a bit of an "overkill" solution, as of course it requires KDE (and most Ubuntu users will not want this).

enter image description here

I did not have my joystick plugged in for the above screenshot, but I have tried it before and it works.

JStest gtk and joystick

These are two tools included in the Ubuntu repositories that I have not tested recently (I found these when looking for other options). The first of the two, jstest-gtk, is a graphical tool, and joystick is a set of commandline utilities.

You can install them using:

sudo apt-get install jstest-gtk 

or

sudo apt-get install joystick

Jstest-gtk is a front end to joystick's commandline tools.