Main Features of Input Remapper
In addition to remapping of various keyboard keys and mouse buttons, Input Remapper also supports macro, allowing you to simulate execution of inputs in predefined patterns and sequences. You can even define a custom macro that handles input from multiple input devices connected to your Linux system. The macro feature is implemented using a custom, but easy to understand scripting language.
Input Remapper supports reading events from multimedia keys and it can remap them. It can also handle modifier keys like <Shift>, <Alt>, and <Ctrl> and remap their behavior when used in combination with other keys.
Input Remapper also supports gaming mice with more than three buttons. It can handle middle mouse button clicks as well as scroll events. Other devices it can handle include trackballs, touchpads, steering wheels, foot pedals and other usb input devices that are used for creating music and playing games.
Input Remapper includes support for emitting symbols and languages different from your current keyboard layout. For instance, you can map a key on an English layout keyboard to emit a Chinese language character.
Input Remapper is one of the few available applications that can support input remapping on Wayland display protocol. It also supports long press, press and release and double tap events.
Note that for the Input Remapper to work correctly, you need to physically press the mapped button. For instance if you mapped <F1> key to <Ctrl+C>, the remapping won’t work until you press the <F1> key. Any third party program that simulates pressing of <F1> key through software solutions may fail to invoke <Ctrl+C> mapping.
Installing Input Remapper in Linux
An installable “deb” package is available for Ubuntu and its derivatives on the releases page of Input Remapper. Once downloaded, you can double click on the “deb” package to install it from the package manager.
A package for Arch Linux is available in Arch User Repository (AUR) and it can be installed from here. You can also install the AUR package from the command line by following installation instructions available here.
For other Linux distributions, you will need to compile it from source code. Instructions for manually building the app are available here.
Using Input Remapper
Once installed, launch Input Remapper from the main menu. You will be presented with a new window similar to this:
The user interface is divided into four parts. The top row allows you to pick connected input devices from a dropdown menu. The left hand side pane allows you to save your customizations to presets or profiles. You can create different profiles for different sets of customizations and invoke them separately. The center pane allows you to create a new entry for any keyboard key or mouse button for which you want to set a new mapping. The right hand side pane allows you to define the key / button for which you want to change mappings as well as custom mappings.
For instance, to map middle mouse button to <CTRL+A> (select all), the workflow would be: click on “new entry” in the center pane > click on “Change Key” button in the right hand side pane > press middle mouse button > select input device from the dropdown menu in the right hand side pane > enter new mapping (KEY_LEFTCTRL+A) > Click on “Apply” button in the left hand side pane. Here is a screenshot illustrating this:
Note that the entry field (numbered 5 in the screenshot above) supports auto completion. So you can enter partial key names to get proper syntax. In case you want to check all identifiers for keyboard keys and mouse clicks, run the following command in terminal:
Further details and usage instructions for entering key combinations can be found here.
In the same field (numbered 5 in the screenshot above), you can enter macro syntax as well. As stated earlier, Input Remapper uses a custom scripting language for defining macro. Detailed instructions and rule sets for defining macro can be found here.
Here is a small example where a macro command “key(c).key(space)” has been entered to change the behavior of the middle mouse button. It now simulates pressing the <c> key on the keyboard, followed by the <space> key.
To stop injection of current mappings, click on the “Stop Injection” button located on the top right corner.
Finally toggle on the “Autoload” button on the left hand side pane to automatically apply your presets on fresh system boot.
For any further usage instructions, you can follow official documentation available here.
Conclusion
Input Remapper makes it easy to remap keyboard keys and mouse clicks. It is especially useful for applications and games where custom keyboard shortcuts cannot be defined or have limited functionality. It also supports macro functionality, allowing you to automate sequential inputs. Beware though, some online multiplayer games may ban your account if they find usage of custom input macro while playing the game.