Solution 1:

Besides the software that Mik mentioned in his answer, I would also recommend that you check out the program AntiMicro. I started developing it as a replacement for QJoyPad but there are some features that AntiMicro has that QJoyPad lacks. Some of the more noteworthy features are that multiple keys can be assigned to one controller button (Shift+Tab), macros allow for conditional button presses, set integration for changing button configurations on the fly, and the program uses a tray icon that works properly under Unity.

The project is hosted on GitHub and the latest deb files can be found at my website.

https://github.com/Ryochan7/antimicro

http://www.ryochan7.com/files/projects/antimicro/antimicro_0.7-1_amd64.deb

Solution 2:

Clear alternatives are joy2key, which is available in the repositories, and rejoystick, which I discuss further below.

1) Fixing compilation problems

However, I believe it is possible to sort out your compilation problems with qjoypad now that you have posted the error messages. It is worth trying to get it compiled as you may find the QT interface much easier to use than the command-line one of joy2key.

Your error message suggests that you need libxtst6 and libxtst-dev, which have been in the repositories for the last 6 Ubuntu releases. So please run

sudo apt-get install libxtst6 libxtst-dev

If you have any further errors you may need to ensure that you have the QT development libraries installed, as they are necessary for building the interface.

sudo apt-get install libqt4-dev

More information is detailed in my answer here, which explains how to compile qjoypad and then set up your joystick.


2) Alternatives

a) joy2key

In the package description, it is noted that

joy2key allows one to choose keyboard events for joystick axes and buttons, so that a joystick or gamepad can be used with an application that doesn't have native joystick support.

Unfortunately, there is no gui (or none that I know of) that yet exists for joy2key, so an essential read is man joy2key and, for example, this and other threads on Ubuntuforums, which go into detail as to how to set it up, although it can be tricky to get it right.

Even though you can save your joy2key configuration in .joy2keyrc; it is difficult to share configurations, as the joystick needs calibrating properly on your machine. However, you may be able to find some layouts for your joystick/gamepad on other forums if you face problems setting your own up.

b) Rejoystick

If you have problems with joy2key, rejoystick would probably be better, as it has a gui (see screenshot) that you use to setup your joypad (see screenshot). You can install the deb from sourceforge. You connect your joypad, launch the settings gui by entering rejoystick in terminal, and then you enter your settings and click ok to save the profile to ~/.rejoystickrc. Then you just run rejoystick -d before you launch your game; enter killall -s SIGKILL rejoystick to clear the current bindings in effect. It does seem to work, but I'm not sure if you can have different profiles like you can with qjoypad.

enter image description here

In short, I highly recommend trying the solutions given further above to solve the compiling problems with qjoypad, as joy2key can be a pain to get set up correctly, although rejoystick is much simpler and may be useful.