Ниже приведены коды клавиш, которыми можно пользоваться при проверке параметра Key в обработчиках событий OnKeyDown и OnKeyUp, при записи строк и ряде других случаев. Символы кириллицы соответствуют тем клавишам с латинскими символами, на которых они размещены.
Клавиша | Десятичное число | Шестнадцатеричное число | Символическое имя | Сравнение по функции ord |
---|---|---|---|---|
F1 | 112 | $70 | VK_F1 | |
F2 | 113 | $71 | VK_F2 | |
F3 | 114 | $72 | VK_F3 | |
F4 | 115 | $73 | VK_F4 | |
F5 | 116 | $74 | VK_F5 | |
F6 | 117 | $75 | VK_F6 | |
F7 | 118 | $76 | VK_F7 | |
F8 | 119 | $77 | VK_F8 | |
F9 | 120 | $78 | VK_F9 | |
F10 | 121 | $79 | VK_F10 | |
пробел | 32 | $20 | VK_SPACE | |
BackSpace | 8 | $8 | VK_BACK | |
Tab | 9 | $9 | VK_TAB | |
Enter | 13 | $0D | VK_RETURN | |
Shift | 16 | $10 | VK_SHIFT | |
Ctrl | 17 | $11 | VK_CONTROL | |
Alt | 18 | $12 | VK_MENU | |
CapsLock | 20 | $14 | VK_CAPITAL | |
Esc | 27 | $1B | VK_ESCAPE | |
Insert | 45 | $2D | VK_INSERT | |
PageUp | 33 | $21 | VK_PRIOR | |
PageDown | 34 | $22 | VK_NEXT | |
End | 35 | $23 | VK_END | |
Home | 36 | $24 | VK_HOME | |
¬ | 37 | $25 | VK_LEFT | |
| 38 | $26 | VK_UP | |
® | 39 | $27 | VK_RIGHT | |
¯ | 40 | $28 | VK_DOWN | |
Delete | 46 | $2E | VK_DELETE | |
PrintScreen | 44 | $2C | VK_SNAPSHOT | |
ScrollLock | 145 | $91 | VK_SCROLL | |
Pause | 19 | $13 | VK_PAUSE | |
NumLock | 144 | $90 | VK_NUMLOCK | |
0 ) | 48 | $30 | ord('0') | |
1 ! | 49 | $31 | ord('1') | |
2 @ | 50 | $32 | ord('2') | |
3 # | 51 | $33 | ord('3') | |
4 $ | 52 | $34 | ord('4') | |
5 % | 53 | $35 | ord('5') | |
6 ^ | 54 | $36 | ord('6') | |
7 & | 55 | $37 | ord('7') | |
8 * | 56 | $38 | ord('8') | |
9 ( | 57 | $39 | ord('9') | |
` ~ | 192 | $C0 | ||
- _ | 189 | $BD | ||
= + | 187 | $BB | ||
[ { | 219 | $DB | ||
] } | 221 | $DD | ||
; : | 186 | $BA | ||
' " | 222 | $DE | ||
\ | | 220 | $DC | ||
, < | 188 | $BC | ||
. > | 190 | $BE | ||
/ ? | 191 | $BF | ||
a A | 65 | $41 | ord('A') | |
b B | 66 | $42 | ord('B') | |
c C | 67 | $43 | ord('C') | |
d D | 68 | $44 | ord('D') | |
e E | 69 | $45 | ord('E') | |
f F | 70 | $46 | ord('F') | |
g G | 71 | $47 | ord('G') | |
h H | 72 | $48 | ord('H') | |
i I | 73 | $49 | ord('I') | |
j J | 74 | $4A | ord('J') | |
k K | 75 | $4B | ord('K') | |
l L | 76 | $4C | ord('L') | |
m M | 77 | $4D | ord('M') | |
n N | 78 | $4E | ord('N') | |
o O | 79 | $4F | ord('') | |
p P | 80 | $50 | ord('P') | |
q Q | 81 | $51 | ord('Q') | |
r R | 82 | $52 | ord('R') | |
s S | 83 | $53 | ord('S') | |
t T | 84 | $54 | ord('T') | |
u U | 85 | $55 | ord('U') | |
v V | 86 | $56 | ord('V') | |
w W | 87 | $57 | ord('W') | |
x X | 88 | $58 | ord('X') | |
y Y | 89 | $59 | ord('Y') | |
z Z | 90 | $5A | ord('Z') | |
На правой клавиатуре при выключенной клавише NumLock | ||||
0 | 96 | $60 | VK_NUMPAD0 | |
1 | 97 | $61 | VK_NUMPAD1 | |
2 | 98 | $62 | VK_NUMPAD2 | |
3 | 99 | $63 | VK_NUMPAD3 | |
4 | 100 | $64 | VK_NUMPAD4 | |
5 | 101 | $65 | VK_NUMPAD5 | |
6 | 102 | $66 | VK_NUMPAD6 | |
7 | 103 | $67 | VK_NUMPAD7 | |
8 | 104 | $68 | VK_NUMPAD8 | |
9 | 105 | $69 | VK_NUMPAD9 | |
* | 106 | $6A | VK_MULTIPLY | |
+ | 107 | $6B | VK_ADD | |
- | 109 | $6D | VK_SUBTRACT | |
. | 110 | $6E | VK_DECIMAL | |
/ | 111 | $6F | VK_DIVIDE |