keyd
A system-wide Linux key remapping daemon that uses kernel input primitives, with per-application layer overrides and a v2 configuration format.
keyd is a system-wide key remapping daemon for Linux, built to replace the medley of X11-specific tools such as xcape and xmodmap that Linux otherwise requires for key remapping. It works below the display server, using kernel-level input primitives, so its remaps are not tied to X11 alone.
Per-application overrides live in a configuration file, mapping key combinations differently depending on which application is focused, and are applied by a companion mapper process that is typically started with the display server; experimental support for single-board computers is available through a USB gadget mode. The configuration format has changed across versions, and migrating an existing v1 configuration to v2 means rereading the manual page. Packages are maintained by the community for Alpine, Arch, Debian, Fedora, Gentoo, openSUSE, Ubuntu, and Void Linux.