Last Updated : 27 Sep, 2024
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).
Syntaxshowkey [-h|--help] [-a|--ascii] [-s|--scancodes] [-k|--keycodes]Basic Example
To start using the showkey command and examine the codes sent by your keyboard, run the following:
sudo showkey
This will display the key codes for each key pressed on the keyboard.
Key Options with the showkey command 1. showkey -h:This option prints to the standard error output its version number, a compile option and a short usage message, then exits.
sudo showkey -h2. showkey -s:
To start showkey in scan code dump mode, use the -s option. This will display the raw scan codes sent by the keyboard:
sudo showkey -s3. showkey -k:
This option starts showkey in keycode dump mode. This is the default when no command line options are present.
sudo showkey -k4. showkey -a:
This option will start showkey in 'ascii' dump mode.
sudo showkey -aConclusion
The 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.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4