Linux homelab — swap Ctrl and Caps keys in console mode
Jan 16, 2026
Goal: swap keys directly by editing the layout mapping
Get Thomas Bucaioni’s stories in your inbox
Join Medium for free to get updates from this writer.
Dump the current layout, for example dvorak
mkdir -p /etc/kbd/
dumpkeys > /etc/kbd/dvorak-ctrlcaps.mapChange the 29 and 58 entries
keycode 29 = Control
keycode 58 = Caps_LockTest it
loadkeys /etc/kbd/dvorak-ctrlcaps.mapMake it persistent in /etc/vconsole.conf
KEYMAP=/etc/kbd/dvorak-ctrlcaps.mapPress enter or click to view image in full size![]()









