← 返回命令列表

Linux command

showkey 命令

安全

权限或系统影响较大,执行前请核对目标。

常用示例

View

sudo showkey

Display

sudo showkey -s

Display

sudo showkey -k

Display

sudo showkey -a

说明

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.

参数

-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.

FAQ

What is the showkey command used for?

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.

How do I run a basic showkey example?

Run `sudo showkey` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -s, --scancodes do in showkey?

Display scancodes in hexadecimal.