2 Key Names
dxtr edited this page 2026-10-14 04:26:09 +02:00
This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Key Names

Keys are keywords of the type key, named for their place on a US keyboard. event-key, the physical key, is always one of them, and is :unknown for a key without a name. event-symbol, the logical key, uses the same names, or is nil. See Keyboard.

The evdev column is the Linux key code, which event-scancode returns on Wayland and X11 and which evdev-key turns into a key. On Windows, event-scancode is the key's set 1 scancode instead, with #xE000 added for the keys Windows marks as extended, such as Right Control, #xE01D; the keys are named the same as on Linux.

Letters and digits

Keys evdev
:a :b :c … :z :q to :p are 16–25, :a to :l are 30–38, :z to :m are 44–50
:digit-1 … :digit-9, :digit-0 2–11, the row above the letters

Punctuation

Key US character evdev
:grave ` 41
:minus - 12
:equal = 13
:left-bracket [ 26
:right-bracket ] 27
:backslash \ 43
:semicolon ; 39
:apostrophe ' 40
:comma , 51
:period . 52
:slash / 53
:intl-backslash the extra key left of Z on ISO keyboards 86

Whitespace and editing

Key evdev
:escape 1
:backspace 14
:tab 15
:return 28
:space 57
:insert 110
:delete 111
:home 102
:end 107
:page-up 104
:page-down 109

Arrows

Key evdev
:up 103
:left 105
:right 106
:down 108

Modifiers and locks

Key evdev
:left-shift, :right-shift 42, 54
:left-control, :right-control 29, 97
:left-alt, :right-alt 56, 100
:left-super, :right-super 125, 126
:menu 127
:caps-lock 58
:num-lock 69
:scroll-lock 70

AltGr is :right-alt.

Function keys

Keys evdev
:f1 … :f10 59–68
:f11, :f12 87, 88
:f13 … :f24 183–194

Keypad

Key evdev
:keypad-0 82
:keypad-1, :keypad-2, :keypad-3 79, 80, 81
:keypad-4, :keypad-5, :keypad-6 75, 76, 77
:keypad-7, :keypad-8, :keypad-9 71, 72, 73
:keypad-decimal 83
:keypad-comma 121
:keypad-add 78
:keypad-subtract 74
:keypad-multiply 55
:keypad-divide 98
:keypad-equal 117
:keypad-enter 96

With Num Lock off, the keypad's digit and decimal keys are logically :home, :up, :page-up, :left, :right, :end, :down, :page-down, :insert and :delete. Their physical names stay :keypad-….

System and media

Key evdev
:print-screen 99
:pause 119
:mute 113
:volume-down 114
:volume-up 115

Physical only

These keys appear as event-key but never as event-symbol: :intl-backslash, :mute, :volume-down and :volume-up.

In code

(typep :keypad-enter 'win:key)   ; => T
(win:evdev-key 30)               ; => :A
(win:evdev-key 500)              ; => :UNKNOWN