LOADKEYS(1)
๐ loadkeys โ load keyboard translation tables ๐
okay bestie, sit down, hydrate, because this is the little utility from the kbd family that decides what your keyboard actually means when you smash it. it's giving main character energy for your entire console. let's go ๐ซถ
โจ SYNOPSIS โจ
loadkeys [OPTION]... FILENAME...
loadkeys --default
loadkeys --mktable
loadkeys --bkeymap
loadkeys --tkeymap[=shape]
loadkeys --parse
๐ธ DESCRIPTION ๐ธ
so basically loadkeys reads the file (or files!) you hand it in FILENAME.... its whole ~purpose~ in life is loading the kernel keymap for your console. you can point it at a specific console device with the -C option (or --console, same vibe).
๐ RESET TO DEFAULT ๐
if you pass -d (or --default), loadkeys loads a default keymap โ probably the file defkeymap.map, living either in /usr/share/kbd/keymaps or in /usr/src/linux/drivers/tty/vt. (probably the first one was user-defined, while the second is a qwerty keyboard map for PCs โ which might not be what you wanted, lowkey ๐ญ)
sometimes, when you've got a strange keymap loaded (like, the minus key is on some obscure unknown modifier combo and you're just ๐ง suffering), it's way easier to type:
loadkeys defkeymap.map
๐ LOAD KERNEL KEYMAP ๐
the main function of loadkeys is loading or modifying the keyboard driver's translation tables. when you're listing file names, standard input can be denoted by a dash (-). and if you specify no file at all? the data gets read from standard input. periodt.
for lots of countries and keyboard types, appropriate keymaps already exist, so something like:
loadkeys uk
might just do the thing you want โจ. on the other hand, constructing your own keymap is easy. the user has to tell what symbols belong to each key. she can find the keycode for a key using showkey(1), while the keymap format is given in keymaps(5) and can also be seen from the output of dumpkeys(1). iykyk ๐
๐ฆ LOAD KERNEL ACCENT TABLE ๐ฆ
if your input file contains no compose key definitions, the kernel accent table is left untouched โ unless you give the -c option (or --clearcompose), in which case the kernel accent table gets emptied. empty. gone. bye ๐ซถ
if your input file does contain compose key definitions, then all the old definitions get removed and replaced by the new entries you specified. the kernel accent table is a sequence of entries (68 by default!) describing how dead diacritical signs and compose keys behave. for example, a line like:
compose ',' 'c' to ccedilla
means that <ComposeKey><,><c> must be combined to <ccedilla>. you can peek at the current content of this table with:
dumpkeys --compose-only
๐ LOAD KERNEL STRING TABLE ๐
the -s option (or --clearstrings) clears the kernel string table. if you don't give this option, loadkeys will only add or replace strings โ it will not remove them. (so yeah, the -s option is required to reach a well-defined state, fr fr.)
the kernel string table is a sequence of strings with names like F31. you can make function key F5 (on an ordinary PC keyboard) produce the text Hello!, and Shift+F5 produce Goodbye!, using lines like:
keycode 63 = F70 F71
string F70 = "Hello!"
string F71 = "Goodbye!"
in the keymap. the default bindings for the function keys are certain escape sequences, mostly inspired by the VT100 terminal. iconic behavior honestly.
๐ CREATE KERNEL SOURCE TABLE ๐
if you give the -m option (or --mktable), loadkeys prints to standard output a file that may be used as /usr/src/linux/drivers/tty/vt/defkeymap.c, specifying the default key bindings for a kernel. and heads up โ it does not modify the current keymap. slay, no side effects ๐
โญ CREATE BINARY KEYMAP โญ
if you give the -b option (or --bkeymap), loadkeys prints to standard output a file that may be used as a binary keymap, exactly as expected by the Busybox loadkmap command. and again โ it does not modify the current keymap. ๐
๐ CREATE TEXT KEYMAP ๐
if you give the -t option (or --tkeymap), loadkeys prints to standard output a file that may be used as a text keymap, as expected by the loadkeys command itself. and yes โ it does not modify the current keymap.
you can also hand it an optional argument to pick the shape of the output format: -tshape (or --tkeymap=shape).
the available shapes are:
2โ default output.4โ one line for each keycode.8โ one line for each (modifier,keycode) pair.16โ one line for each keycode until the 1st hole.
๐ง UNICODE MODE ๐ง
loadkeys automatically detects whether the console is in Unicode or ASCII (XLATE) mode. when a keymap is loaded, literal keysyms (such as section) are resolved accordingly; numerical keysyms are converted to fit the current console mode, regardless of the way they are specified (decimal, octal, hexadecimal or Unicode). no cap.
the -u switch (or --unicode) forces loadkeys to convert all keymaps to Unicode. if the keyboard is in a non-Unicode mode, such as XLATE, loadkeys will change it to Unicode for the time of its execution. a warning message will be printed in this case. โ ๏ธ
it is recommended to runkbd_mode(1)beforeloadkeysinstead of using the-uoption.
๐ OTHER OPTIONS ๐
-a,--asciiโ force conversion to ASCII.-h,--helpโloadkeysprints its version number and a short usage message to the program's standard error output and exits.-p,--parseโloadkeyssearches and parses the keymap without taking any action.-q,--quietโloadkeyssuppresses all normal output. shhh ๐คซ-V,--versionโloadkeysprints the version number and exits.
๐ WARNING ๐
okay bestie this part is important, read it twice.
anyone with read access to /dev/console can run loadkeys and therefore change the keyboard layout โ possibly making it unusable. ๐ญ and note that the keyboard translation table is common for all the virtual consoles, so any changes to the keyboard bindings affect all the virtual consoles simultaneously.
also, because the changes affect all the virtual consoles, they outlive your session. which means that even at the login prompt, the key bindings may not be what the user expects. no takebacks, no undo, it's giving permanent ๐ณ
๐ FILES ๐
/usr/share/kbd/keymapsโ default directory for keymaps./usr/src/linux/drivers/tty/vt/defkeymap.mapโ default kernel keymap.
๐ซถ SEE ALSO ๐ซถ
and that's the whole page, bestie โจ this one's from the kbd fam, dated way back on 6 Feb 1994 โ vintage but still absolutely serving in every console you'll ever touch. go forth and remap responsibly ๐ธ๐
๐ฆ where this page comes from
- arch rolling: kbd 2.10.0-1 ยท GPL-2.0-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms