In addition to the specific key codes, other allowable keypress events are:
•any = any key •num = any number key on the regular keyboard •numpad = any number on the number pad •alpha = any character of the 26-character alphabet •funct = any function key Common Key Codes
Key
|
Code
|
Key
|
Code
|
Key
|
Code
|
Key
|
Code
|
Key
|
Code
|
Key
|
Code
|
1
|
1
|
Pad1
|
79
|
F1
|
59
|
A
|
30
|
N
|
49
|
Enter
|
28
|
2
|
2
|
Pad2
|
80
|
F2
|
60
|
B
|
48
|
O
|
24
|
Space
|
57
|
3
|
3
|
Pad3
|
81
|
F3
|
61
|
C
|
46
|
P
|
25
|
lShift
|
42
|
4
|
4
|
Pad4
|
75
|
F4
|
62
|
D
|
32
|
Q
|
16
|
lCtrl
|
29
|
5
|
5
|
Pad5
|
76
|
F5
|
63
|
E
|
18
|
R
|
19
|
lAlt
|
56
|
6
|
6
|
Pad6
|
77
|
F6
|
64
|
F
|
33
|
S
|
31
|
rShift
|
54
|
7
|
7
|
Pad7
|
71
|
F7
|
65
|
G
|
34
|
T
|
20
|
rCtrl
|
157
|
8
|
8
|
Pad8
|
72
|
F8
|
66
|
H
|
35
|
U
|
22
|
rAlt
|
184
|
9
|
9
|
Pad9
|
73
|
F9
|
67
|
I
|
23
|
V
|
47
|
;
|
39
|
0
|
10
|
Pad0
|
82
|
F10
|
68
|
J
|
36
|
W
|
17
|
'
|
40
|
|
|
|
|
F11
|
87
|
K
|
37
|
X
|
45
|
,
|
51
|
|
|
|
|
F12
|
88
|
L
|
38
|
Y
|
21
|
.
|
52
|
|
|
|
|
|
|
M
|
50
|
Z
|
44
|
/
|
53
|
Less Popular But Still Loved
Key
|
Code
|
Key
|
Code
|
Key
|
Code
|
-
|
12
|
Home
|
199
|
PgDn
|
209
|
[
|
26
|
Insert
|
210
|
PgUp
|
201
|
]
|
27
|
Left
|
203
|
Right
|
205
|
`
|
41
|
LWin
|
219
|
rWin
|
220
|
=
|
13
|
NumLock
|
69
|
ScrollLock
|
70
|
Apps
|
221
|
PadCom
|
91
|
SysRq
|
183
|
Backspace
|
14
|
PadDec
|
83
|
Tab
|
15
|
CapsLock
|
58
|
PadDivide
|
181
|
Up
|
200
|
Delete
|
211
|
PadEnter
|
156
|
|
|
Down
|
208
|
PadMinus
|
74
|
|
|
End
|
207
|
PadMult
|
55
|
|
|
Esc
|
---
|
Pause
|
116
|
|
|
Joystick & Mouse Codes

Joystick
|
Code
|
Mouse
|
Code
|
Button 1
|
241
|
Left-Click
|
252
|
Button 2
|
242
|
Right-Click
|
253
|
Button 3
|
243
|
Mid-Click
|
254
|
Up
|
244
|
Other-Click
|
255
|
Up-Right
|
245
|
|
|
Right
|
246
|
|
|
Down-Right
|
247
|
|
|
Down
|
248
|
|
|
Down-Left
|
249
|
|
|
Left
|
250
|
|
|
Up-Left
|
251
|
|
|
Note about joystick codes: You must first make sure your joystick is set up to work with Windows programs. You can set up your joystick by selecting "Gaming Options" or "Joystick" in the Windows Control Panel. You might need to "add" your joystick if you do not see it currently configured there. When you check this, it's also a good idea to calibrate your joystick using the calibration utility provided by Windows. The movement codes above (i.e., 244-251) are triggered as follows: DirectRT divides the joystick range into 8, 45 degree angles (like cutting a pizza into 8 slices). As soon as the joystick has moved more than half of it's range in any direction, DirectRT determines which of the 8 "slices" the joystick is in and takes that as the response and records the RT at that point. See also: Continuous Joystick Capture.
Note about mouse codes: You may choose to have subjects respond with mouse clicks rather than key presses. This can easily be done with the mouse codes above. Note that you will not see the mouse cursor.
See also
Using Key Codes in the Time Column.
|