The key codes module contains a list of constants representing numeric codes for
keys, modifiers and mouse buttons.
These codes are used by key and mouse events, and by the polled input module.
Mouse Button
|
Value
|
Left mouse button
|
MOUSE_LEFT
|
Right mouse button
|
MOUSE_RIGHT
|
Middle mouse button
|
MOUSE_MIDDLE
|
Modifier
|
Value
|
Shift modifier
|
MODIFIER_SHIFT
|
Control modifier
|
MODIFIER_CONTROL
|
Option modifier
|
MODIFIER_OPTION
|
System modifier
|
MODIFIER_SYSTEM
|
Command modifier
|
MODIFIER_COMMAND
|
Key
|
Value
|
Backspace
|
KEY_BACKSPACE
|
Tab
|
KEY_TAB
|
Clear
|
KEY_CLEAR
|
Return
|
KEY_RETURN
|
Enter
|
KEY_ENTER
|
Pause
|
KEY_PAUSE
|
Escape
|
KEY_ESCAPE
|
Space
|
KEY_SPACE
|
Page Up
|
KEY_PAGEUP
|
Page Down
|
KEY_PAGEDOWN
|
End
|
KEY_END
|
Home
|
KEY_HOME
|
Cursor (Left)
|
KEY_LEFT
|
Cursor (Up)
|
KEY_UP
|
Cursor (Right)
|
KEY_RIGHT
|
Cursor (Down)
|
KEY_DOWN
|
Select
|
KEY_SELECT
|
Print
|
KEY_PRINT
|
Execute
|
KEY_EXECUTE
|
Screen
|
KEY_SCREEN
|
Insert
|
KEY_INSERT
|
Delete
|
KEY_DELETE
|
Help
|
KEY_HELP
|
0
|
KEY_0
|
1
|
KEY_1
|
2
|
KEY_2
|
3
|
KEY_3
|
4
|
KEY_4
|
5
|
KEY_5
|
6
|
KEY_6
|
7
|
KEY_7
|
8
|
KEY_8
|
9
|
KEY_9
|
A
|
KEY_A
|
B
|
KEY_B
|
C
|
KEY_C
|
D
|
KEY_D
|
E
|
KEY_E
|
F
|
KEY_F
|
G
|
KEY_G
|
H
|
KEY_H
|
I
|
KEY_I
|
J
|
KEY_J
|
K
|
KEY_K
|
L
|
KEY_L
|
M
|
KEY_M
|
N
|
KEY_N
|
O
|
KEY_O
|
P
|
KEY_P
|
Q
|
KEY_Q
|
R
|
KEY_R
|
S
|
KEY_S
|
T
|
KEY_T
|
U
|
KEY_U
|
V
|
KEY_V
|
W
|
KEY_W
|
X
|
KEY_X
|
Y
|
KEY_Y
|
Z
|
KEY_Z
|
Sys key (Left)
|
KEY_LSYS
|
Sys key (Right)
|
KEY_RSYS
|
Numpad 0
|
KEY_NUM0
|
Numpad 1
|
KEY_NUM1
|
Numpad 2
|
KEY_NUM2
|
Numpad 3
|
KEY_NUM3
|
Numpad 4
|
KEY_NUM4
|
Numpad 5
|
KEY_NUM5
|
Numpad 6
|
KEY_NUM6
|
Numpad 7
|
KEY_NUM7
|
Numpad 8
|
KEY_NUM8
|
Numpad 9
|
KEY_NUM9
|
Numpad *
|
KEY_NUMMULTIPLY
|
Numpad +
|
KEY_NUMADD
|
Numpad -
|
KEY_NUMSUBTRACT
|
Numpad .
|
KEY_NUMDECIMAL
|
Numpad /
|
KEY_NUMDIVIDE
|
F1
|
KEY_F1
|
F2
|
KEY_F2
|
F3
|
KEY_F3
|
F4
|
KEY_F4
|
F5
|
KEY_F5
|
F6
|
KEY_F6
|
F7
|
KEY_F7
|
F8
|
KEY_F8
|
F9
|
KEY_F9
|
F10
|
KEY_F10
|
F11
|
KEY_F11
|
F12
|
KEY_F12
|
Num Lock
|
KEY_NUMLOCK
|
Scroll Lock
|
KEY_SCROLL
|
Shift (Left)
|
KEY_LSHIFT
|
Shift (Right)
|
KEY_RSHIFT
|
Control (Left)
|
KEY_LCONTROL
|
Control (Right)
|
KEY_RCONTROL
|
Alt key (Left)
|
KEY_LALT
|
Alt key (Right)
|
KEY_RALT
|
Tilde
|
KEY_TILDE
|
Minus
|
KEY_MINUS
|
Equals
|
KEY_EQUALS
|
Bracket (Open)
|
KEY_OPENBRACKET
|
Bracket (Close)
|
KEY_CLOSEBRACKET
|
Backslash
|
KEY_BACKSLASH
|
Semi-colon
|
KEY_SEMICOLON
|
Quote
|
KEY_QUOTES
|
Comma
|
KEY_COMMA
|
Period
|
KEY_PERIOD
|
Slash
|
KEY_SLASH
|