Keyboard Mapper is a small application for Linux desktops allowing you to map keys of different input devices to specific actions.

In that way, it allows you to use a second keyboard as some sort of application launcher. Or you could use unused buttons from your mouse as multimedia keys.



Initial configuration

In order to let the X server ignore the input from the device used dedicated for your actions, you have to configure the following in your X server configuration:

Section "InputClass"
    Identifier      "some unique identifier choosen by you"
    MatchIsKeyboard "on"
    MatchProduct    "The product name of the input device (see "xinput list")"
    Option          "Ignore" "true"

Also make sure, your user has the permission to access the device files (located in /dev/input).

After that, you can start the application and select the input devices to use in the settings as shown bellow.


Starting the application will present you the main window:

Add your first entry by clicking the "Add shortcut" button in the toolbar or selecting it from the application menu. This action will open the "Edit shortcut" window:

Click the "Click to set shortcut" button which will prompt you to press the key on the input device to use for your shortcut.

After that, select one of the following actions to do once you press the key:

Known issues

Application theme is different from other applications

When installing PySide2 using pip, it's possible that the application does not use the native desktop theme. In that case, simply install PySide2 using your package manager.

In case of Debian based Linux distributions (e.g. Ubuntu, Mint, etc.), install PySide2 using the following command:

sudo apt-get install python3-pyside2.qtcore python3-pyside2.qtgui python3-pyside2.qtwidgets

After that, you should remove PySide2 which has been installed by pip using pip3 uninstall PySide2. Otherwise, the application continues to use PySide installed with pip.