LinuxCommandLibrary

kbdinfo

Display keyboard information

SYNOPSIS

kbdinfo [-C N] [-l] [-s]

PARAMETERS

-C N
    Select keyboard device N (default 0)

-l
    Print current keyboard layout information

-s
    Use short output format

DESCRIPTION

kbdinfo is a utility from the Linux kbd package that queries and prints information about the current keyboard driver and mode in console environments. It helps diagnose keyboard setup, showing details like the driver name (e.g., pc-keyb), operational mode (RAW, MEDIUMRAW, XLATE, or UNICODE), and scancode translations.

Primarily used on virtual terminals (e.g., tty1 via Ctrl+Alt+F1), it reveals how the kernel processes keypresses before passing them to applications. For example, XLATE mode converts scancodes to keycodes for standard input, while RAW delivers unaltered scancodes for low-level applications.

This command is essential for console configuration, verifying loadkeys effects or resolving input issues. It supports multi-keyboard systems and optional layout or codepage details. Output is concise, aiding scripts or manual checks in text-mode systems.

Note: It does not affect graphical sessions like X11 or Wayland, focusing solely on kernel console drivers.

CAVEATS

Requires root privileges (in /sbin). Works only on console TTYs, not graphical desktops. Output depends on kernel keyboard support.

TYPICAL OUTPUT

Short mode (-s):
driver: pc-keyb
mode: XLATE

Full mode:
driver: pc-keyb
mode: translate
xlate: 0x67 -> 'g' (kp) ...

FILES

Reads from /dev/tty and kernel ioctls. Layouts from /usr/share/keymaps.

HISTORY

Part of the kbd package since early Linux console tools (1990s). Developed by Risto Kankkunen and others for managing PS/2 and USB keyboards. Latest in kbd 2.6.x series (2023+), aligned with kernel input subsystem evolution.

SEE ALSO

loadkeys(1), dumpkeys(8), kbd-mode(8), setkeycodes(8), showkey(1)

Copied to clipboard