Linux Keyboard in a Console
To switch to a console: Ctrl
+Alt
+F1
…F6
. To switch back:
Ctrl
+Alt
+F7
.
The rest is about manipulating keymap, e.g. to swap CapsLock
with Ctrl
.
To manipulate the keyboard layout in a virtual console use dumpkeys, showkey and loadkeys. Man for keymap file.
Save the Keymap
sudo dumpkeys > backup.kmap
Check the keycodes
Use sudo showkey
to learn the keycodes:
- Left Ctrl - 29, denoted
Control
- CapsLock - 58, denoted
CtrlL_Lock
Create a new keymap
Create file swap-capslock-ctrl.kmap
:
keymaps 0-127
keycode 29 = CtrlL_Lock
keycode 58 = Control
Load the keymap
sudo loadkeys swap-capslock-ctrl.kmap