key-remapper

Crates.iokey-remapper
lib.rskey-remapper
version0.3.8
created_at2025-10-14 22:35:35.245523+00
updated_at2026-01-08 06:48:17.382857+00
descriptionA binary for remapping modifier keys
homepage
repositoryhttps://madeline.baggins.family/view/key-remapper/README.md
max_upload_size
id1883319
size27,816
Madeline Baggins (MadelineBaggins)

documentation

README

Key-Remapper

key-remapper is a Rust program I wrote to replace my use of xremap. Mostly it was an excuse to play around with Steel, a lisp dialect implemeted in Rust.

This lisp configuration was however, pretty rough. I replaced it with maddi-xml, the configuration library I wrote for my personal projects that provides colored and helpful error messages (though it is clunkier than competing libraries).

key-remapper allows the remapping of keys such that a different keycode can be sent when the key is held vs tapped. This allows me to use caps as both an escape and control key for example.

Installation

key-remapper can be installed via its flake, or through crates.io via cargo install key-remapper.

Usage

The remapper runs as a root service and takes a single argument that is the configuration file.

key-remapper <CONFIG>

Example configuration

Note that keyboard names can be found by looking for entries in /proc/bus/input/devices.

Names for keys can be found here. Note that only the suffix is required (MINUS rather than KEY_MINUS for example).

Note also that this remapping is done at the evdev device layer. If you're using a layout other than QWERTY, you'll be remapping the keys before they are remapped into your layout.

<config>
  <keyboard name="Apple MTP keyboard">
    <remap key="RIGHTMETA" on_pressed="MINUS"/>
    <modifier key="CAPSLOCK" on_pressed="ESC" on_held="LEFTCTRL"/>
    <modifier key="ENTER" on_pressed="ENTER" on_held="LEFTCTRL"/>
  </keyboard>
</config>

Options

Currently, there's only one option that can be enabled for a keyboard called debug that prints all the events received from that keyboard to the command line. This can be useful for finding names for keys.

<keyboard debug name="Apple MTP keyboard">
...
</keyboard>
Commit count: 0

cargo fmt