Stay organized with collections
Save and categorize content based on your preferences.
blockly > utils > KeyCodes
utils.KeyCodes enum
Key codes for common characters.
Copied from Closure's goog.events.KeyCodes
This list is not localized and therefore some of the key codes are not correct for non US keyboard layouts. See comments below.
Signature:
export declare enum KeyCodes
Enumeration Members
Member |
Value |
Description |
A |
65 |
|
ALT |
18 |
|
APOSTROPHE |
192 |
|
AT_SIGN |
64 |
|
B |
66 |
|
BACKSLASH |
220 |
|
BACKSPACE |
8 |
|
C |
67 |
|
CAPS_LOCK |
20 |
|
CLOSE_SQUARE_BRACKET |
221 |
|
COMMA |
188 |
|
CONTEXT_MENU |
93 |
|
CTRL |
17 |
|
D |
68 |
|
DASH |
189 |
|
DELETE |
46 |
|
DOWN |
40 |
|
E |
69 |
|
EIGHT |
56 |
|
END |
35 |
|
ENTER |
13 |
|
EQUALS |
187 |
|
ESC |
27 |
|
F |
70 |
|
F1 |
112 |
|
F10 |
121 |
|
F11 |
122 |
|
F12 |
123 |
|
F2 |
113 |
|
F3 |
114 |
|
F4 |
115 |
|
F5 |
116 |
|
F6 |
117 |
|
F7 |
118 |
|
F8 |
119 |
|
F9 |
120 |
|
FF_DASH |
173 |
|
FF_EQUALS |
61 |
|
FF_HASH |
163 |
|
FF_SEMICOLON |
59 |
|
FIRST_MEDIA_KEY |
166 |
|
FIVE |
53 |
|
FOUR |
52 |
|
G |
71 |
|
H |
72 |
|
HOME |
36 |
|
I |
73 |
|
INSERT |
45 |
|
J |
74 |
|
K |
75 |
|
L |
76 |
|
LAST_MEDIA_KEY |
183 |
|
LEFT |
37 |
|
M |
77 |
|
MAC_ENTER |
3 |
|
MAC_FF_META |
224 |
|
MAC_WK_CMD_LEFT |
91 |
|
MAC_WK_CMD_RIGHT |
93 |
|
META |
91 |
|
N |
78 |
|
NINE |
57 |
|
NUM_CENTER |
12 |
|
NUM_DIVISION |
111 |
|
NUM_EIGHT |
104 |
|
NUM_FIVE |
101 |
|
NUM_FOUR |
100 |
|
NUM_MINUS |
109 |
|
NUM_MULTIPLY |
106 |
|
NUM_NINE |
105 |
|
NUM_ONE |
97 |
|
NUM_PERIOD |
110 |
|
NUM_PLUS |
107 |
|
NUM_SEVEN |
103 |
|
NUM_SIX |
102 |
|
NUM_THREE |
99 |
|
NUM_TWO |
98 |
|
NUM_ZERO |
96 |
|
NUMLOCK |
144 |
|
O |
79 |
|
ONE |
49 |
|
OPEN_SQUARE_BRACKET |
219 |
|
P |
80 |
|
PAGE_DOWN |
34 |
|
PAGE_UP |
33 |
|
PAUSE |
19 |
|
PERIOD |
190 |
|
PHANTOM |
255 |
|
PLUS_SIGN |
43 |
|
PRINT_SCREEN |
44 |
|
Q |
81 |
|
QUESTION_MARK |
63 |
|
R |
82 |
|
RIGHT |
39 |
|
S |
83 |
|
SCROLL_LOCK |
145 |
|
SEMICOLON |
186 |
|
SEVEN |
55 |
|
SHIFT |
16 |
|
SINGLE_QUOTE |
222 |
|
SIX |
54 |
|
SLASH |
191 |
|
SPACE |
32 |
|
T |
84 |
|
TAB |
9 |
|
THREE |
51 |
|
TILDE |
192 |
|
TWO |
50 |
|
U |
85 |
|
UP |
38 |
|
V |
86 |
|
VK_NONAME |
252 |
|
W |
87 |
|
WIN_IME |
229 |
|
WIN_KEY |
224 |
|
WIN_KEY_FF_LINUX |
0 |
|
WIN_KEY_RIGHT |
92 |
|
X |
88 |
|
Y |
89 |
|
Z |
90 |
|
ZERO |
48 |
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-18 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-09-18 UTC."],[[["\u003cp\u003e\u003ccode\u003eutils.KeyCodes\u003c/code\u003e provides a list of key codes for common characters, corresponding to their numerical values.\u003c/p\u003e\n"],["\u003cp\u003eThis list is based on Closure's \u003ccode\u003egoog.events.KeyCodes\u003c/code\u003e and may not be accurate for all keyboard layouts, particularly non-US layouts.\u003c/p\u003e\n"],["\u003cp\u003eThe enumeration includes key codes for letters, numbers, symbols, and special keys like Enter, Backspace, and Control.\u003c/p\u003e\n"],["\u003cp\u003eIt's important to note that this list is not localized and some key codes may not be correct for non-US keyboard layouts.\u003c/p\u003e\n"]]],[],null,["[blockly](./blockly.md) \\\u003e [utils](./blockly.utils_namespace.md) \\\u003e [KeyCodes](./blockly.utils_namespace.keycodes_enum.md)\n\nutils.KeyCodes enum\n-------------------\n\nKey codes for common characters.\n\nCopied from Closure's goog.events.KeyCodes\n\nThis list is not localized and therefore some of the key codes are not correct for non US keyboard layouts. See comments below.\n\n**Signature:** \n\n export declare enum KeyCodes \n\nEnumeration Members\n-------------------\n\n| Member | Value | Description |\n|----------------------|-------|-------------|\n| A | `65` | |\n| ALT | `18` | |\n| APOSTROPHE | `192` | |\n| AT_SIGN | `64` | |\n| B | `66` | |\n| BACKSLASH | `220` | |\n| BACKSPACE | `8` | |\n| C | `67` | |\n| CAPS_LOCK | `20` | |\n| CLOSE_SQUARE_BRACKET | `221` | |\n| COMMA | `188` | |\n| CONTEXT_MENU | `93` | |\n| CTRL | `17` | |\n| D | `68` | |\n| DASH | `189` | |\n| DELETE | `46` | |\n| DOWN | `40` | |\n| E | `69` | |\n| EIGHT | `56` | |\n| END | `35` | |\n| ENTER | `13` | |\n| EQUALS | `187` | |\n| ESC | `27` | |\n| F | `70` | |\n| F1 | `112` | |\n| F10 | `121` | |\n| F11 | `122` | |\n| F12 | `123` | |\n| F2 | `113` | |\n| F3 | `114` | |\n| F4 | `115` | |\n| F5 | `116` | |\n| F6 | `117` | |\n| F7 | `118` | |\n| F8 | `119` | |\n| F9 | `120` | |\n| FF_DASH | `173` | |\n| FF_EQUALS | `61` | |\n| FF_HASH | `163` | |\n| FF_SEMICOLON | `59` | |\n| FIRST_MEDIA_KEY | `166` | |\n| FIVE | `53` | |\n| FOUR | `52` | |\n| G | `71` | |\n| H | `72` | |\n| HOME | `36` | |\n| I | `73` | |\n| INSERT | `45` | |\n| J | `74` | |\n| K | `75` | |\n| L | `76` | |\n| LAST_MEDIA_KEY | `183` | |\n| LEFT | `37` | |\n| M | `77` | |\n| MAC_ENTER | `3` | |\n| MAC_FF_META | `224` | |\n| MAC_WK_CMD_LEFT | `91` | |\n| MAC_WK_CMD_RIGHT | `93` | |\n| META | `91` | |\n| N | `78` | |\n| NINE | `57` | |\n| NUM_CENTER | `12` | |\n| NUM_DIVISION | `111` | |\n| NUM_EIGHT | `104` | |\n| NUM_FIVE | `101` | |\n| NUM_FOUR | `100` | |\n| NUM_MINUS | `109` | |\n| NUM_MULTIPLY | `106` | |\n| NUM_NINE | `105` | |\n| NUM_ONE | `97` | |\n| NUM_PERIOD | `110` | |\n| NUM_PLUS | `107` | |\n| NUM_SEVEN | `103` | |\n| NUM_SIX | `102` | |\n| NUM_THREE | `99` | |\n| NUM_TWO | `98` | |\n| NUM_ZERO | `96` | |\n| NUMLOCK | `144` | |\n| O | `79` | |\n| ONE | `49` | |\n| OPEN_SQUARE_BRACKET | `219` | |\n| P | `80` | |\n| PAGE_DOWN | `34` | |\n| PAGE_UP | `33` | |\n| PAUSE | `19` | |\n| PERIOD | `190` | |\n| PHANTOM | `255` | |\n| PLUS_SIGN | `43` | |\n| PRINT_SCREEN | `44` | |\n| Q | `81` | |\n| QUESTION_MARK | `63` | |\n| R | `82` | |\n| RIGHT | `39` | |\n| S | `83` | |\n| SCROLL_LOCK | `145` | |\n| SEMICOLON | `186` | |\n| SEVEN | `55` | |\n| SHIFT | `16` | |\n| SINGLE_QUOTE | `222` | |\n| SIX | `54` | |\n| SLASH | `191` | |\n| SPACE | `32` | |\n| T | `84` | |\n| TAB | `9` | |\n| THREE | `51` | |\n| TILDE | `192` | |\n| TWO | `50` | |\n| U | `85` | |\n| UP | `38` | |\n| V | `86` | |\n| VK_NONAME | `252` | |\n| W | `87` | |\n| WIN_IME | `229` | |\n| WIN_KEY | `224` | |\n| WIN_KEY_FF_LINUX | `0` | |\n| WIN_KEY_RIGHT | `92` | |\n| X | `88` | |\n| Y | `89` | |\n| Z | `90` | |\n| ZERO | `48` | |"]]