A lightweight Linux/Wayland key remapper written in Rust, using evdev for input handling and uinput for virtual device creation.
Requires Rust
git clone https://github.com/Shikaru0/keymapper.git
cd keymapper
cargo build --releasekeymapper list-devices # list evdev input devices
keymapper monitor /dev/input/event0 # stream key events to stdout
keymapper remap # start the daemon (reads config.toml)
keymapper remap /dev/input/event0 # start with an explicit deviceAuto-generated at ~/.config/keymapper/config.toml on first run:
# Configuration for keymapper.
# Path to the evdev input device (e.g., /dev/input/event0).
input_device = "/dev/input/event0"
# Remap table for keymapper.
[[remap]]
from = "KEY_A"
to = "KEY_B"
[[remap]]
from = "KEY_CAPSLOCK"
to = "KEY_ESC"
[[remap]]
from = "KEY_F1"
to = ["KEY_LEFTCTRL", "KEY_T"]to can be a single key name or a list of key names for combo triggers. Key names are the KEY_* constants from /usr/include/linux/input-event-codes.h.
Editing config.toml while the daemon runs hot-swaps the remap table, so no restart is needed.
sudo usermod -aG input $USER
sudo usermod -aG uinput $USERLog out and back in for the changes to take effect.
The daemon grabs the physical input device exclusively, creates a uinput virtual keyboard, and forwards every event through it — translating keys that match a remap rule before emitting. This works under both X11 and Wayland.