Use the new Key Mapper GUI on Linux to remap the keyboard and mouse buttons (support X11 and Wayland)

Key mapper Is a new GUI tool for remapping keyboard and mouse buttons on the Linux desktop (it supports both X11 and Wayland).

The app supports presets for each device, it allows the use of timed macros, and has functions such as repeating keys, waiting between keys, and holding down modifiers while using keys. In addition to keyboard and mouse, Key Mapper also has basic support for gamepads.

Other features include support to stop any mapping and use the system default settings of the device (using Apply Defaults Button), and supports automatic loading of presets for plugging in devices when logging in. In addition, Key Mapper uses evdev to read the key code and display it inside the application, so the user does not have to perform this operation manually.

The application does not support binding commands or scripts to keyboard or mouse buttons. For this, please refer to this article in Linux Uprising.

For future versions, developers plan to add support for mapping D-Pad and joystick directions as buttons, automatically load presets when plugging in the device after logging in, and map combined button presses to buttons.

Using the “Key Mapper”, you can assign actions associated with keyboard or mouse buttons to other buttons. You can also use it to assign a macro (a series of keys/actions) to the keys.

When you run Key Mapper for the first time, you need to select the device (mouse or keyboard) from the device drop-down list. Choose a device and you can start creating new presets to easily remap keyboard or mouse buttons.

Left click Key Column, and then press the keyboard key or mouse button to be remapped, it will be displayed in the key box.If this does not work, you may need to click Apply Defaults Display the button on the right side of the device drop-down menu, then add the key.

After entering the key to be remapped, it is time to select its mapping.Click inside Mapping The cell corresponding to the key you want to remap, and then start typing the key to remap the button to.You can enter the first few letters instead of the entire word, for example, you can enter “con” and the drop-down list should show the available options, such as control_l, control_r,and many more:

Key mapper mapping drop-down list

After completing the mapping, click Save Button.Finally, click Apply Start using the new mapping.You must first Save New mapping and click Apply Button, otherwise the change will be invalid!

You might like: How to record and play mouse and keyboard events with Atbswp macro recorder (GUI)

It is worth noting that using key combinations as a mapping is not as simple as you might think, at least not using the latest version (because as I already mentioned, mapping the combined key press to the key is on the to-do list).For example, if you want to use Ctrl + F1 As a key map, add control_l+f1 To key mapper Mapping The column will not work. Instead, you will need to use this macro as a mapping: m(control_l, k(f1)).

For information on how to use macros, check out the key mapper Macro document, Which also includes some examples.

Download key mapper

By using the python3-key-mapper DEB package, Key Mapper can be easily installed on Debian/Ubuntu and Linux-based distributions (such as Linux Mint, Pop!_OS, Zorin OS, Elementary OS, etc.).application Publish page.

Arch Linux and Manjaro users can install Key Mapper with the following command: AUR package.

You can also use PIP to install Key Mapper as Explain here, Can be used on any Linux distribution (I don’t recommend combining PIP with sudo Although; also, in some Linux distributions, you will need to use pip3 instead pipBecause this requires Python 3).

It is important to note that unless you are in the input user group, some devices may not be visible to Key Mapper.You can run sudo usermod -a -G input $USER, Or use Key Mapper built-in permission repair command sudo key-mapper-service --setup-permissions. After that, you need to log out and log in again or restart the system, otherwise Key Mapper will not work (please note that in my case, logging out is not enough, so I have to reboot the system).

You might like:

  • How to use AutoKey on Linux to automatically perform repeated typing (text expansion)
  • Save time and increase productivity with Espanso Text Expander (Linux, Windows, macOS)