Key Remapping in Linux with keyd

20 December 2025

There are many ways to handle key remapping in Linux, from various utilities to configuring them in your desktop environment. After trying quite a few I settled on keyd because of its ease of use and the benefit of getting a system wide remapping regardless of environment or tty.

keyd runs as a system service using kernel level input primitives so as soon as your system boots you get your custom key remapping. Caps Lock as CTRL in your tty, you got it and more! Check out the official keyd repository for more details and available features.

Getting Started

After installing keyd for your distribution enable the service with sudo systemctl enable keyd --now. Create a configuration in /etc/keyd/default.conf and reload the config with sudo keyd reload.

Here is a simple configuration that I’m currently using on my system to get started.

[ids]

*

[main]
# Maps capslock to escape when pressed and control when held.
capslock = overload(control, esc)

# Swap super and left alt keys
leftalt = leftmeta
leftmeta = leftalt

Disable While Typing (Touchpad)

Sometimes there are issues with disabling your laptop touchpad while typing on a Linux system. There is really good information on The Linux Touchpad Dev Guide that describes how to diagnose and fix this problem if you are encountering it. The author includes an example and a fix to DWT not working with keyd in this post.


comments powered by Disqus