Linux: Find Keyboard Key Scancode

By Xah Lee. Date: . Last updated: .

How find the scancode of a key?

  1. First, switch to Virtual Console. [see Linux: How to use Virtual Console]
  2. Then, type showkey --scancodes.
  3. Then, 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 Keybinding Howto

Mouse

Linux Desktop keys