Skip to content
Shikaru0Public

About

A lightweight Linux/Wayland key remapper written in Rust, using evdev for input handling and uinput for virtual device creation.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

18 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

keymapper

A lightweight Linux/Wayland key remapper written in Rust, using evdev for input handling and uinput for virtual device creation.

CI License: MIT Built with Rust Wayland

Building

Requires Rust

git clone https://github.com/Shikaru0/keymapper.git
cd keymapper
cargo build --release

Usage

keymapper 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 device

Config

Auto-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.

Permissions

sudo usermod -aG input $USER
sudo usermod -aG uinput $USER

Log out and back in for the changes to take effect.

How does it work?

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.

About

A lightweight Linux/Wayland key remapper written in Rust, using evdev for input handling and uinput for virtual device creation.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages