![]() |
VOOZH | about |
showkey command in Linux is used to examine the codes sent by the keyboard. showkey prints to standard output either the scan codes or the key code or the 'ASCII' code of each key pressed. The program runs in the first two modes until 10 seconds have elapsed since the last key press or release event, or until it receives a suitable signal, like SIGTERM, from another process. In `ascii' mode the program terminates when the user types ^D (Ctrl+D).
showkey [-h|--help] [-a|--ascii] [-s|--scancodes] [-k|--keycodes]To start using the showkey command and examine the codes sent by your keyboard, run the following:
sudo showkey👁 Basic ExampleThis will display the key codes for each key pressed on the keyboard.
This option prints to the standard error output its version number, a compile option and a short usage message, then exits.
sudo showkey -h👁 showkey -hTo start showkey in scan code dump mode, use the -s option. This will display the raw scan codes sent by the keyboard:
sudo showkey -s👁 showkey -sThis option starts showkey in keycode dump mode. This is the default when no command line options are present.
sudo showkey -k👁 showkey -kThis option will start showkey in 'ascii' dump mode.
sudo showkey -a👁 showkey -aThe showkey command in Linux is a powerful tool for examining and diagnosing keyboard inputs. Whether you're trying to capture scan codes, key codes, or ASCII values, this command provides valuable information for debugging and troubleshooting. It's particularly useful for keyboard diagnostics, key remapping, and developers working on input devices.