Even though turbo has already mentioned
qjoypad very briefly, it is worth providing a longer answer, as the very latest (and best) version needs compiling, as it is not in the repositories and there is currently no package available at the site either. Secondly, there are general older blog guides regarding
qjoypad, but it would be useful to have an up-to-date one for Ubuntu.
What I do with
Dosbox when there are problems with games and controller support (which is most of the time) is to use a program such as qjoypad. This utility
Incorporates your gaming devices into any XWindows program. qjoyPad takes input from a gamepad or joystick and translates it into key strokes or mouse actions, letting you control any XWindows program with your game controller.
so that it doesn't matter whether
wine or the actual game within
wine supports the joypad, you will generally be able to use it.
Install the dependencies (and
build-essential if necessary) with:
sudo apt-get install libxtst6 libxtst-dev libx11-dev checkinstall build-essential
You will need the QT libraries to run the program, and the QT dev libraries to compile
qjoypad, as noted on the official site, so you must also install the entire QT development kit with
sudo apt-get install libqt4-dev
This is very important as you are using the QT libraries to build the gui.
Download the latest version (currently 4.10) from Sourceforge and then extract it with
tar xzvf qjoypad-4.1.0.tar.gz
cd to that folder and then
cd to the
src folder and run
sudo checkinstall --pkgname=qjoypad --pkgversion=4.1.0 --provides=qjoypad
Now connect your joystick or gamepad and run from terminal
qjoypad & or select it from the launcher menu.
When you load up
qjoypad (screenshot one) you will see button numbers such as button 1, button 2, etc. If you wish to see what these correspond to on your joystick you could install
evtest and run
evtest and then select the device number of your gamepad to get the following information:
Input device ID: bus 0x3 vendor 0x45e product 0x7 version 0x100
Input device name: "Microsoft® Microsoft® SideWinder® Game Pad USB"
Event type 0 (EV_SYN)
Event type 1 (EV_KEY)
Event code 304 (BTN_A)
Event code 305 (BTN_B)
Event code 306 (BTN_C)
Event code 307 (BTN_X)
Event code 308 (BTN_Y)
Event code 309 (BTN_Z)
Event code 310 (BTN_TL)
Event code 311 (BTN_TR)
Event code 312 (BTN_TL2)
Event code 313 (BTN_TR2)
The button order here reflects that in
qjoypad, so qjoypad's button 1 is
BTN_A on the controller, etc.
(Your joypad layouts are stored in
~/.qjoypad3 if you want to back them up.)
The readme in the download with the source code also has some useful information about setting up and running
1) Click add to create a new profile and name it, and then you can assign all the buttons available, but you must click update to save your settings.
2) You can fully configure all the axis points, and both sidewinder type and dual analog devices seem to be configurable. More details on this are available in this article and on the useful readme included with the source code download.
Qjoypad needs to be running (with your correct joypad game profile selected) when
wine is launched.
You need to define your keyboard bindings first in the game in which you want to use
qjoypad. Very often in your game itself the setting should be set to keyboard and not joystick. This is what I have found with
Dosbox games, and it is probably the same for
Wine games. Both for gaming and for controlling any program running in an X window,
qjoypad is a very useful utility.