Dec 15, 2020

Gamepad/Joystick in Wine (Ubuntu 20.04)

Configuring a Joystick or Joypad for Wine in Ubuntu 20.04 is pretty simple.

Start by installing the joystick tools:

    sudo apt-get install joystick 

If you have an analog controller it may need calibration:

    jscal -c /dev/input/js0 

Save calibration to file:

    jscal -p /dev/input/js0 > joystick1.cal

To load calibration later just source the file:

    source joystick1.cal

Start by checking that you controller works as expected in Wine by running:

    wine control

This will bring up the Wine Control Panel.



Lauch your game

    wine mygame.exe 

and locate the settings to map the controller.



1 comment:

  1. Hi Patrik,
    I have followed all your instructions, but I cannot find a device file in the /dev/input folder after installing the package.
    With : cat /proc/bus/input/devices I find all my connected devices (I have a sound card on the main board and an analogue sound card for the joystick). The output with cat /proc/bus/input/devices shows me:

    I: Bus=0000 Vendor=0000 Product=0000 Version=0000
    N: Name="HDA ATI HDMI HDMI/DP,pcm=3"
    P: Phys=ALSA
    S: Sysfs=/devices/pci0000:00/0000:00:03.0/0000:01:00.1/sound/card1/input7
    U: Uniq=
    H: Handlers=event6
    B: PROP=0
    B: EV=21
    B: SW=140
    This shut be my analog joystick card...

    But with: jstest /dev/input/js0 the error message comes up:
    jscal: can't open joystick device: No such file or directory

    It seams that Ubuntu LTS 20.04 provides not such a analog joystick :-(

    Do you have another idea?

    Regards

    Reiner

    ReplyDelete