Snap Tap / SOCD-style keyboard input handling for Linux (Wayland & X11)
KeyResolve is a low-latency userspace input interceptor for Linux that enforces mutually exclusive movement keys (e.g. A/D, W/S) using a last-pressed-wins policy.
It works by intercepting raw keyboard events via evdev, applying deterministic key logic, and re-emitting corrected events through a virtual keyboard (uinput).
This approach works reliably on Wayland, X11, and in games that use raw input.
- ✅ Last-pressed-wins logic for movement keys
- ✅ Guarantees no simultaneous
A+DandW+S - ✅ Works on Wayland and X11
- ✅ Game-compatible (raw input / evdev level)
- ✅ Written in Rust
- ✅ No kernel modules
- ✅ No compositor plugins
- ✅ Clean Ctrl-C shutdown (no stuck keys)
Navigate to the Releases and download the binary for your architecture.
git clone https://github.com/Antosser/KeyResolve.git
cd KeyResolve
cargo build --releaseThe binary will be located at:
target/release/KeyResolve
KeyResolve needs access to:
/dev/input/event*(read)/dev/uinput(write)
Create /etc/udev/rules.d/99-input.rules:
KERNEL=="event*", SUBSYSTEM=="input", GROUP="input", MODE="660"
KERNEL=="uinput", GROUP="input", MODE="660"Reload rules:
sudo udevadm control --reload-rules
sudo udevadm triggersudo usermod -aG input $USERThen log out or reboot.
Run the program:
./KeyResolveYou will be prompted to select which keyboard to grab.
Once running:
- Pressing A releases D
- Pressing D releases A
- Pressing W releases S
- Pressing S releases W
- When the last pressed key is released, the previous still-held key (if any) is restored
Exit cleanly with Ctrl+C.
-
The selected keyboard is exclusively grabbed
-
If the program crashes, input from that keyboard may temporarily stop
-
Always test from:
- a TTY, or
- an SSH session, or
- with a second keyboard available
The program handles Ctrl-C correctly and releases all keys on exit.
- ✅ Linux
- ✅ Wayland
- ✅ X11
- ❌ Windows
- ❌ macOS
- X11 remapping does not work reliably on Wayland
- Many games bypass X11 entirely
KeyResolveoperates at the evdev level, where games actually read input
Contributions are welcome!
Good areas to help with:
- Generalizing key-pair handling
- Adding configuration support
- Improving documentation
- Testing on different keyboards
- Packaging (Arch / Nix / etc.)
cargo check
cargo clippy
cargo fmtPlease keep changes:
- Idiomatic Rust
- Well-commented
- Minimal unsafe code (preferably none)
GPL-3.0 License
See LICENSE for details.