c-hjkl remaps Ctrl + hjkl into arrow keys on Linux. (X11/Wayland/Console)
I've been using AutoKey on my Linux desktop to remap keys, but it has problems:
- It stops working on Wayland.
- It gets laggy when keys are repeatedly pressed, since it needs to run a Python script each macro keystroke.
So here I built one that solves the above problems for me. All I needed was just remapping Ctrl-H/J/K/L into arrow keys like Vim.
It reads and retains exclusive access to your keyboard (/dev/input/...
) and creates a new UInput device(a virtual keyboard) that gets piped with the keyboard events from your actual keyboard. Then, whenever it encounters a combination it wants to override (i.e. C-hjkl), it does not forward the original key events and sends the fake key events.
No. this project's scope will be limited to C-hjkl for now. But I'll accept PRs if you make it as an option!
- Implement the basic functionality
- Auto-detect keyboard input devices and grab them
- Provide installable artifacts on popular Linux distros (e.g. *.deb, *.rpm, ...)