LinuxCommandLibrary

dumpkeys

Dump keyboard translation tables

SYNOPSIS

dumpkeys [options]

PARAMETERS

-c, --console-codes
    Dump the kernel's table of console control sequences.

-fn, --full-numbers
    Print all numbers (keysyms, keycodes, etc.) in hexadecimal format rather than decimal.

-s, --short-composition
    Print only the first key for multi-key (compose) sequences, shortening the output.

-t, --tables
    Print the kernel's action code tables, which can be useful for debugging.

-u, --unicode
    Dump Unicode values for dead keys and composite keys, rather than keysyms.

-n, --numeric
    Print keysyms numerically (in hexadecimal) instead of their symbolic names.

-r, --raw
    Print the raw scan code to keycode mapping table. This is the lowest level of keyboard mapping.

-h, --help
    Display a help message and exit.

-v, --version
    Display version information and exit.

DESCRIPTION

The dumpkeys command is a utility used on Linux systems to display the current keyboard translation table, also known as the keymap, loaded into the kernel. This keymap defines how raw scan codes generated by the keyboard hardware are interpreted and translated into key symbols (keysyms) and actions.

The primary purpose of dumpkeys is to output this keymap in a human-readable format, suitable for analysis, backup, or subsequent modification and reloading using the loadkeys command. It's particularly useful for understanding the behavior of special keys, modifier states (Shift, Ctrl, Alt), and dead keys.

By default, dumpkeys outputs the keymap in a format similar to that used by keymap files, allowing administrators and users to inspect or troubleshoot keyboard layouts on the virtual consoles. It operates at the kernel level, distinct from graphical environment keymap utilities like xmodmap or setxkbmap.

CAVEATS

dumpkeys primarily interacts with the kernel's console keymap and is therefore relevant for the Linux text console (TTYs) rather than graphical environments like X Window System. For X, utilities such as xmodmap or setxkbmap are used.

While dumping the keymap usually doesn't require elevated privileges, modifying or loading a keymap using loadkeys typically requires root access or appropriate permissions.

OUTPUT FORMAT

The output of dumpkeys is designed to be directly readable by the loadkeys command. This allows users to save the current keymap to a file, edit it, and then reload the modified keymap. For example, to save the current keymap to a file named 'mykeymap.map', you would run 'dumpkeys > mykeymap.map'. To later load this map, you would use 'sudo loadkeys mykeymap.map'.

HISTORY

dumpkeys is an integral part of the kbd package, a collection of Linux console tools for configuring the keyboard and console fonts. It has been a fundamental utility for managing keyboard layouts on the Linux console since the early days of the kernel's keyboard support. Its design reflects the need for a persistent, easily modifiable text-based keymap system, allowing users to customize their console keyboard behavior without needing a graphical environment.

SEE ALSO

Copied to clipboard