loadkeys
Load keyboard translation tables
TLDR
Load a default keymap
Load default keymap when an unusual keymap is loaded and - sign cannot be found
Create a kernel source table
Create a binary keymap
Search and parse keymap without action
Load the keymap suppressing all output
Load a keymap from the specified file for the console
Use standard names for keymaps of different locales
SYNOPSIS
loadkeys [-C console] [-d] [-h] [-m mapfile] [-q] [-s] [-v] [-V] [keymapfile]
PARAMETERS
-C console
Specifies the console to load the keymap to. If omitted, it defaults to the current console.
-d
Prints the default keymap to standard output. It shows how default keys are encoded in the system.
-h
Displays a help message and exits.
-m mapfile
Merges the keymap found in mapfile into the current keymap. Useful to implement partial overrides.
-q
Quiet mode. Suppresses most warning messages.
-s
Merge silently. Suppresses output in case it fails.
-v
Verbose mode. Prints additional information during the loading process.
-V
Displays the version number and exits.
keymapfile
The path to the keymap file to load. If omitted, the keymap is read from standard input.
DESCRIPTION
The loadkeys command loads keyboard translation tables from a specified file or standard input into the kernel. These tables define the mapping between scan codes (hardware signals from the keyboard) and keycodes (internal representations of keys). It is crucial for configuring keyboard layouts that differ from the system's default. This command lets you customize which character is generated when a particular key is pressed, allowing you to adapt the keyboard to different languages or personal preferences. By loading custom keymaps, loadkeys enables users to effectively redefine their keyboard's functionality. It is mostly used to enable non-latin or very specific keyboard setups.
This tool is particularly helpful when dealing with keyboard layouts not natively supported by the system or when creating customized keyboard configurations for specific applications or user workflows. When no file is specified, it loads from standard input.
Use with caution as incorrect keymaps may lock the keyboard.
CAVEATS
Loading an incorrect keymap can render the keyboard unusable. It is advised to have a way to remotely access the system or revert the changes via other means if issues arise. Backup your config before making changes.
KEYMAP FILE FORMAT
Keymap files are plain text files that define the mapping between scancodes, keycodes, and symbols. Understanding the format is necessary for creating custom keyboard layouts. Refer to the keymaps(5) manual page for detailed information on the keymap file syntax.
EXAMPLE
To load a custom keymap file named 'my_keymap.map', the command would be: loadkeys my_keymap.map
HISTORY
The loadkeys command has been a part of the Linux kernel's user-space utilities for a long time, initially developed to provide flexible keyboard configuration capabilities. Early versions focused on allowing users to adapt their keyboards to different languages and character sets. Over time, the command has been enhanced with features such as console selection and merging, providing more fine-grained control over keyboard layouts. It's been a vital tool in enabling customized keyboard configurations across various Linux distributions.