User Tools

Site Tools


ubuntu:joystick

Ubuntu - Joystick

Install the Joystick Driver

sudo apt-get install xboxdrv

Set permissions

sudo chmod 666 /dev/uinput

Use the Joystick

sudo xboxdrv

When you move the joystick, you should see the numbers change.


Run quite

Change the sudo xboxdrv live as above to the following to run quite.

sudo xboxdrv --silent --detach-kernel-driver --daemon

Calibrating the gamepad

sudo apt install jstest-gtk

Open the tool, select your device and press the “Properties” button. This will open up a new window which contains positioning indicators for your device's buttons and knobs.

This screen can be used to figure out whether everything is working properly, and if your gamepad needs calibration because of “inherent” offset.

Press the “Calibration” button located on the lower right and then press the “Start Calibration” on the newly opened window.

Then follow the instructions and your gamepad axes will get calibrated.

If you press the “Mapping” button, you will be given the capacity to change the order of the buttons of your device.

Any changes done through here are applied widely in all your games and applications.


Another method

sudo modprobe joydev
sudo modprobe uinput
sudo rmmod xpad
blacklist xpad
sudo apt install xboxdrv jscalibrator xboxdrvctl

NOTE: The blacklist xpad is if you want to edit the .conf.


Setting and changing between different configurations

If you want to relate gamepad button presses with keyboard or mouse buttons, you can do so through qjoypad. Install qjoypad by typing the following on a terminal:

sudo apt install qjoypad

Then run the tool by typing:

qjoypad –notray

You may add individual layout settings by pressing the “Add” button on the top left of the application and naming them.

If you don't know what button corresponds to what name, you should click on the “Quick Set” button on the lower right that will first prompt you to press a gamepad button, and then assign a keyboard button.

After finishing the various configurations, you may quit the tool and start it from the menu. This will take qjoypad to the tray, allowing you to change between the different configurations.


Another method to setup the Joystick

sudo apt install jscalibrator
jscal -c /dev/input/js0 
jstest /dev/input/js0
jscalibrator

NOTE: Change the 'js0' to the right number.

jscalibrator runs it.


Alternative Driver

Another driver that you can use instead of the xboxdrv is the “ubuntu-xboxdrv” which is based on xboxdrv but is supposedly not plagued by common faults and bugs. In the case that the standard xboxdrv doesn't work for your device.

sudo apt-add-repository -y ppa:rael-gc/ubuntu-xboxdrv
sudo apt-get update
sudo apt-get install ubuntu-xboxdrv

References

ubuntu/joystick.txt · Last modified: 2023/06/26 19:33 by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki