There are three ways to change a keys function:
- Create a custom keyboard layout and set that as the default.
- Use xmodmap (not a good idea, not really standard).
- Use xorg's xkb settings.
If you're using a non-graphical machine the first option is probably what you'll want to pick, but in the case of a xorg machine option 3 is much simpler and better.
You can set xkb settings either with the command line tool
could be placed in your .Xinitrc for user settings or you can set them
systemwide in your xorg config. Most modern distros split the xorg config into
various config files under
To disable the use of the caps lock key you can simply create a file in /etc/X11/xorg.conf.d/ named 90-disable-caps.conf (or similar). Then place the below contents into that file.
Identifier "keyboard defaults"
Option "XKbOptions" "caps:none"
This matches "keyboards" and sets the option
A full list of possible options is located inside
/usr/share/X11/xkb/rules/base.lst. Most of the time you'll want to swap caps
for control or similar instead of outright disabling it.
switch it to caps, but basically that file lists and explains all possible