Linux: Find Keyboard Key Scancode

By Xah Lee. Date: . Last updated: .

How find the scancode of a key?

  1. Switch to Linux: Virtual Terminal, by Ctrl+Alt+F1.
  2. Type showkey --scancodes.
  3. Type any key, it'll print its scancode in hexadecimal.
  4. To exit, just wait for 10 seconds.

Note: you must switch to virtual console for this to work. Normal terminal won't work.

See man showkey and showkey --help

Linux: Scancode, Keycode, Keysym