List of virtual keycodes

06 May 2008
Posted by Michael
Virtual keycodes - a Delphi example

The virtual keycodes give programmers a language and hardware independent way of using the keyboard keys.

Here is a small list of available key codes:

English Name VK-name Hexadecimal
Backspace VK_BACK 08
Tab VK_TAB 09
Enter / Return VK_RETURN 0D
Shift VK_SHIFT 10
Ctrl VK_CONTROL 11
Alt VK_MENU 12
Pause key VK_PAUSE 13
Caps lock VK_CAPITAL 14
Esc VK_ESCAPE 1B
Space VK_SPACE 20
Page Up VK_PRIOR 21
Page Down VK_NEXT 22
End VK_END 23
Home VK_HOME 24
Left arrow VK_LEFT 25
Up arrow VK_UP 26
Right arrow VK_RIGHT 27
Down arrow VK_DOWN 28
Print screen VK_SNAPSHOT 2C
Insert VK_INSERT 2D
Delete VK_DELETE 2E
0 key 30
1..9 key 31-39
A key 41
B key 42
C key 43
D key 44
E key 45
F key 46
G key 47
H key 48
I key 49
J key 4A
K key 4B
L key 4C
M key 4D
N key 4E
O key 4F
P key 50
Q key 51
R key 52
S key 53
T key 54
U key 55
V key 56
W key 57
X key 58
Y key 59
Z key 5A
Numerical keyboard 0 VK_NUMPAD0 60
Numerical keyboard 1-9 VK_NUMPADx 61-69
F1-F12 VK_F1, VK_F2... 70-7B