Linux: How to Find X11 Keycode/Keysym

By Xah Lee. Date: . Last updated: .

X11 Keysym Names

Here's the common ones:

keykeysym
↖ HomeHome
↘ EndEnd
⇞ Page UpPrior
⇟ Page DownNext
arrowUp
arrowDown
arrowRight
arrowLeft
Return ↩Return
Spacespace
Tab ↹Tab
⌫ BackspaceBackspace
⌦ DeleteDelete
EscEscape
F1F1
F2F2
F3F3
▤ MenuMenu
Num LockNum_Lock
keypad +KP_Add
keypad -KP_Subtract
keypad *KP_Multiply
keypad /KP_Divide
keypad enterKP_Enter
keypad .KP_Decimal
keypad 0KP_0
keypad 1KP_1
keypad 2KP_2

How to Find keycode / keysym of a Key?

xev lets you find the keycode / keysym of a key.

type xev in terminal, then press a key. It'll display output in terminal.

note, mouse movement will generate lots of outputs. So, try not to move the mouse.

to quit, mouse click on the close box of the popup window.

linux xev x11 keycode keysym
In terminal, type xev, then press key to find that key's X11 keycode and keysym.

If you don't know what's keycode / keysym, see: Linux: xmodmap Tutorial