QJoyPad is a free and open source graphical application that allows you to map keyboard and mouse events to a game controller. In simple terms, a Linux game that doesn’t support any or your particular game controller can be made to work with a gamepad using QJoyPad.
Some of the main features of QJoyPad are:
- Multiple profiles making it easier to manage and switch mappings
- “Turbo” or “Rapid Fire” button mode
- Sticky mode for simulating “Press and Hold” behavior
- Automatically detects gamepad buttons and axes
- Supports controlling mouse via joysticks
- Comes with full command line support for those who prefer CLI
- Support for setting sensitivity of joysticks
- Comes with many predefined algorithms for controlling mouse cursor sensitivity and acceleration
- Quick set mode that allows you to detect and set individual keys at the same time
To install QJoyPad in Ubuntu, run the following command:
Run command below to launch QJoyPad (or use application launcher):
QJoyPad starts minimized to system tray, so you may not see any GUI window until you click on its panel applet. On some desktop environments, system tray is shown but nothing happens when you click on its menu items. To fix this issue, you have to run QJoyPad in non-system-tray mode by running command below:
Running QJoyPad without system tray will create a small window containing nothing but icon of the app. If you right click on this icon, all the menu options that are available in the system tray will become visible.
Note that some of the QJoyPad options may not work unless you connect a game controller. To see the gamepad mapping window, double click on the icon shown in the screenshot above.
For QJoyPad mappings to work in a game or app, you will have to keep it running. Be careful not to accidentally close the small window with gamepad icon.
SDL2 Gamepad Tool
SDL2 Gamepad Tool is a free and open source app that allows you to configure game controller buttons using an easy to use graphical interface. As the name suggests, it only works for games that use SDL2 API for controller support (most native Linux games).
Using gamepad mapping database available here, it automatically configures mapping for most controllers. However if your game controller mappings are not shown in the app, you can create new mappings for it by clicking on “Create a New Mapping” button. You can also change pre-defined mappings for any controller using the same process.
Note that this app is not a keyboard-to-joypad mapping utility. It just creates SDL compatible mappings for gamepads so that games using SDL API can automatically pick them.
You can download SDL2 gamepad tool from here.
Once you are satisfied with the mappings, there are two methods you can use to enable them for games. Click on “Set Mapping as Environment Variable” to set these mappings system wide for all games.
The other method is to use these mappings on per game basis. Click on “Copy Mapping String” button then run a command in the following format:
For example, the mapping command on my system looks like this:
SC Controller is a GTK3 application that allows you to create button mappings for Steam Controller, DualShock 4 gamepad, Xbox controller, and other similar gamepads. The main highlight of this app is its ability to configure advanced gamepad mappings that are equivalent to Steam client’s built-in configuration tool. In simple terms, SC Controller’s user mode driver / GUI app enables configuring gamepads without having a need to install Steam client (no need to have a Steam account as well). Just like QjoyPad, this app allows you to map keyboard and mouse events to a game controller.
Other useful features of SC Controller:
- Gyroscope configuration support
- Rapid fire or turbo mode functionality
- Supports multiple gamepad profiles
- Vibration / Rumble support
- Macros and controller emulation
- Supports on screen keyboard
SC Controller AppImage for Linux distributions can be downloaded from here. Mark the file executable and run it in a terminal or double click the file to start customizing gamepad mappings.
Note that for some reason, SC Controller fails to detect my DualShock 4 controller unless I run it with root access. Most probably because it fails to read input events from the gamepad. A custom udev rule can possibly fix this issue but explaining it here is beyond the scope of this article. If you are having gamepad detection problems with this app, try running it as root.
These are a few apps that can be used to create mappings for your game controller. Most of the well-known game controller brands work out of the box on Linux these days. However unlike console games, PC games rarely provide an option to remap gamepads. The apps mentioned above are especially useful when you are using a generic controller, when you want to alter the layout of existing button mappings, or when you want to map keyboard and mouse events to a game controller.