LinuxCommandLibrary

mk_modmap

Create keyboard mapping tables

SYNOPSIS

mk_modmap [input_file]

PARAMETERS

input_file
    The input file containing the keyboard mapping specification. If no input_file is specified, mk_modmap reads from standard input.

DESCRIPTION

The mk_modmap command generates a keyboard mapping table suitable for use with the loadkeys command or direct writing to the kernel's keyboard driver. This table defines the mapping between scancodes (physical key presses) and keycodes (logical representations of keys) and allows modification of shift levels (like Shift, Ctrl, Alt).

It takes input in a symbolic format, typically using key names and modifiers like "Shift" and "Control", and translates them into the binary format understood by the kernel. The resulting mapping is then applied via the loadkeys command to customize keyboard behavior. It's useful for remapping keys, creating custom keyboard layouts, and defining special functions.

INPUT FILE FORMAT

The input file should consist of lines in the following format: keycode = or keycode = ...
Where scancode is a hexadecimal number representing the physical key. keysym is the symbolic name for the keycode. Multiple keysyms can be specified to define shift levels (unshifted, Shift, Control, Alt, etc.).
The shift level defines which keysym is produced when specific modifier keys are held down.

OUTPUT

The output of mk_modmap is a binary data stream written to standard output. This output is designed to be piped directly to the loadkeys command, or saved to a file for later use.

SEE ALSO

Copied to clipboard