showkey
Display keyboard keycodes and scancodes
TLDR
SYNOPSIS
showkey [options]
DESCRIPTION
showkey prints to standard output either the scan codes, the keycode, or the ASCII code of each key pressed. This is useful for debugging keyboard-related issues, key remapping, and understanding keyboard input at a low level.In scancode and keycode modes, the program runs until 10 seconds have elapsed since the last key press or release event. In ASCII mode, the program terminates when the user types Ctrl+D.
PARAMETERS
-s, --scancodes
Display scancodes in hexadecimal.-k, --keycodes
Display keycodes in decimal (default mode).-a, --ascii
Display key values in ASCII, decimal, and hexadecimal.-h, --help
Display help message.-V, --version
Print version number and exit.
CAVEATS
Must be run as root or with sudo. Only works on the Linux console, not in terminal emulators under X11 or Wayland. The keyboard becomes unusable for normal input while running.
HISTORY
showkey is part of the kbd (keyboard tools) package for Linux console utilities.
SEE ALSO
loadkeys(1), dumpkeys(1), getkeycodes(1), xmodmap(1)
