1All the constants used to represent keys in pygame:
2Constant ASCII Description
3---------------------------------
4K_BACKSPACE \b backspace
5K_TAB \t tab
6K_CLEAR clear
7K_RETURN \r return
8K_PAUSE pause
9K_ESCAPE ^[ escape
10K_SPACE space
11K_EXCLAIM ! exclaim
12K_QUOTEDBL " quotedbl
13K_HASH # hash
14K_DOLLAR $ dollar
15K_AMPERSAND & ampersand
16K_QUOTE quote
17K_LEFTPAREN ( left parenthesis
18K_RIGHTPAREN ) right parenthesis
19K_ASTERISK * asterisk
20K_PLUS + plus sign
21K_COMMA , comma
22K_MINUS - minus sign
23K_PERIOD . period
24K_SLASH / forward slash
25K_0 0 0
26K_1 1 1
27K_2 2 2
28K_3 3 3
29K_4 4 4
30K_5 5 5
31K_6 6 6
32K_7 7 7
33K_8 8 8
34K_9 9 9
35K_COLON : colon
36K_SEMICOLON ; semicolon
37K_LESS < less-than sign
38K_EQUALS = equals sign
39K_GREATER > greater-than sign
40K_QUESTION ? question mark
41K_AT @ at
42K_LEFTBRACKET [ left bracket
43K_BACKSLASH \ backslash
44K_RIGHTBRACKET ] right bracket
45K_CARET ^ caret
46K_UNDERSCORE _ underscore
47K_BACKQUOTE ` grave
48K_a a a
49K_b b b
50K_c c c
51K_d d d
52K_e e e
53K_f f f
54K_g g g
55K_h h h
56K_i i i
57K_j j j
58K_k k k
59K_l l l
60K_m m m
61K_n n n
62K_o o o
63K_p p p
64K_q q q
65K_r r r
66K_s s s
67K_t t t
68K_u u u
69K_v v v
70K_w w w
71K_x x x
72K_y y y
73K_z z z
74K_DELETE delete
75K_KP0 keypad 0
76K_KP1 keypad 1
77K_KP2 keypad 2
78K_KP3 keypad 3
79K_KP4 keypad 4
80K_KP5 keypad 5
81K_KP6 keypad 6
82K_KP7 keypad 7
83K_KP8 keypad 8
84K_KP9 keypad 9
85K_KP_PERIOD . keypad period
86K_KP_DIVIDE / keypad divide
87K_KP_MULTIPLY * keypad multiply
88K_KP_MINUS - keypad minus
89K_KP_PLUS + keypad plus
90K_KP_ENTER \r keypad enter
91K_KP_EQUALS = keypad equals
92K_UP up arrow
93K_DOWN down arrow
94K_RIGHT right arrow
95K_LEFT left arrow
96K_INSERT insert
97K_HOME home
98K_END end
99K_PAGEUP page up
100K_PAGEDOWN page down
101K_F1 F1
102K_F2 F2
103K_F3 F3
104K_F4 F4
105K_F5 F5
106K_F6 F6
107K_F7 F7
108K_F8 F8
109K_F9 F9
110K_F10 F10
111K_F11 F11
112K_F12 F12
113K_F13 F13
114K_F14 F14
115K_F15 F15
116K_NUMLOCK numlock
117K_CAPSLOCK capslock
118K_SCROLLOCK scrollock
119K_RSHIFT right shift
120K_LSHIFT left shift
121K_RCTRL right control
122K_LCTRL left control
123K_RALT right alt
124K_LALT left alt
125K_RMETA right meta
126K_LMETA left meta
127K_LSUPER left Windows key
128K_RSUPER right Windows key
129K_MODE mode shift
130K_HELP help
131K_PRINT print screen
132K_SYSREQ sysrq
133K_BREAK break
134K_MENU menu
135K_POWER power
136K_EURO Euro
137
138a list of modifier states (from pygame.localspygame constants)
139that can be assembled by bitwise-ORing them together:
140
141Constant Description
142-------------------------
143KMOD_NONE no modifier keys pressed
144KMOD_LSHIFT left shift
145KMOD_RSHIFT right shift
146KMOD_SHIFT left shift or right shift or both
147KMOD_LCTRL left control
148KMOD_RCTRL right control
149KMOD_CTRL left control or right control or both
150KMOD_LALT left alt
151KMOD_RALT right alt
152KMOD_ALT left alt or right alt or both
153KMOD_LMETA left meta
154KMOD_RMETA right meta
155KMOD_META left meta or right meta or both
156KMOD_CAPS caps lock
157KMOD_NUM num lock
158KMOD_MODE AltGr