Keys
There are 255 keys on any keyboard being used on Microsoft Windows.
These keys can all be used by their numeric form, while some can also be used by a string form. The table below defines these values, as well as the name of the physical key each one represents.
Key strings are case-insensitive, and may optionally be wrapped in quotes (ex: km.down(space) or
km.down('space')). Keys without a key string can only be used by their key number.
Some punctuation keys, such as =, /, and ;, have no key string, because those characters cannot be sent as
arguments (see Command Syntax). Use their key number instead.
| Key Number | Key String | Key Name |
|---|---|---|
| 4 | a | A |
| 5 | b | B |
| 6 | c | C |
| 7 | d | D |
| 8 | e | E |
| 9 | f | F |
| 10 | g | G |
| 11 | h | H |
| 12 | i | I |
| 13 | j | J |
| 14 | k | K |
| 15 | l | L |
| 16 | m | M |
| 17 | n | N |
| 18 | o | O |
| 19 | p | P |
| 20 | q | Q |
| 21 | r | R |
| 22 | s | S |
| 23 | t | T |
| 24 | u | U |
| 25 | v | V |
| 26 | w | W |
| 27 | x | X |
| 28 | y | Y |
| 29 | z | Z |
| 30 | 1 | 1 and ! |
| 31 | 2 | 2 and @ |
| 32 | 3 | 3 and # |
| 33 | 4 | 4 and $ |
| 34 | 5 | 5 and % |
| 35 | 6 | 6 and ^ |
| 36 | 7 | 7 and & |
| 37 | 8 | 8 and * |
| 38 | 9 | 9 and ( |
| 39 | 0 | 0 and ) |
| 40 | enter | Return (Enter) |
| 41 | esc | Escape |
| 42 | back | Delete (Backspace) |
| 43 | tab | Tab |
| 44 | space | Spacebar |
| 45 | - | - and _ |
| 46 | = and + | |
| 47 | [ and { | |
| 48 | ] and } | |
| 49 | \ and | | |
| 50 | Non-US # and ~ | |
| 51 | ; and : | |
| 52 | ’ and “ | |
| 53 | Grave Accent and Tilde | |
| 54 | , and < | |
| 55 | . | . and > |
| 56 | / and ? | |
| 57 | caps | Caps Lock |
| 58 | f1 | F1 |
| 59 | f2 | F2 |
| 60 | f3 | F3 |
| 61 | f4 | F4 |
| 62 | f5 | F5 |
| 63 | f6 | F6 |
| 64 | f7 | F7 |
| 65 | f8 | F8 |
| 66 | f9 | F9 |
| 67 | f10 | F10 |
| 68 | f11 | F11 |
| 69 | f12 | F12 |
| 70 | print | Print Screen |
| 71 | scroll | Scroll Lock |
| 72 | pause | Pause |
| 73 | insert | Insert |
| 74 | home | Home |
| 75 | pgup | Page Up |
| 76 | del | Delete Forward |
| 77 | end | End |
| 78 | pgdown | Page Down |
| 79 | right | Right Arrow |
| 80 | left | Left Arrow |
| 81 | down | Down Arrow |
| 82 | up | Up Arrow |
| 83 | Keypad Num Lock and Clear | |
| 84 | Keypad / | |
| 85 | Keypad * | |
| 86 | Keypad - | |
| 87 | Keypad + | |
| 88 | Keypad Enter | |
| 89 | Keypad 1 and End | |
| 90 | Keypad 2 and Down Arrow | |
| 91 | Keypad 3 and Page Down | |
| 92 | Keypad 4 and Left Arrow | |
| 93 | Keypad 5 | |
| 94 | Keypad 6 and Right Arrow | |
| 95 | Keypad 7 and Home | |
| 96 | Keypad 8 and Up Arrow | |
| 97 | Keypad 9 and Page Up | |
| 98 | Keypad 0 and Insert | |
| 99 | Keypad . and Delete | |
| 100 | Non-US \ and | | |
| 101 | aplcat | Application |
| 102 | Power | |
| 103 | Keypad = | |
| 104 | f13 | F13 |
| 105 | f14 | F14 |
| 106 | f15 | F15 |
| 107 | f16 | F16 |
| 108 | f17 | F17 |
| 109 | f18 | F18 |
| 110 | f19 | F19 |
| 111 | f20 | F20 |
| 112 | F21 | |
| 113 | F22 | |
| 114 | F23 | |
| 115 | F24 | |
| 116 | Execute | |
| 117 | Help | |
| 118 | Menu | |
| 119 | Select | |
| 120 | Stop | |
| 121 | Again | |
| 122 | Undo | |
| 123 | Cut | |
| 124 | Copy | |
| 125 | Paste | |
| 126 | Find | |
| 127 | Mute | |
| 128 | Volume Up | |
| 129 | Volume Down | |
| 130 | Locking Caps Lock | |
| 131 | Locking Num Lock | |
| 132 | Locking Scroll Lock | |
| 133 | Keypad Comma | |
| 134 | Keypad Equal Sign | |
| 135 | International1 | |
| 136 | International2 | |
| 137 | International3 | |
| 138 | International4 | |
| 139 | International5 | |
| 140 | International6 | |
| 141 | International7 | |
| 142 | International8 | |
| 143 | International9 | |
| 144 | LANG1 | |
| 145 | LANG2 | |
| 146 | LANG3 | |
| 147 | LANG4 | |
| 148 | LANG5 | |
| 149 | LANG6 | |
| 150 | LANG7 | |
| 151 | LANG8 | |
| 152 | LANG9 | |
| 153 | Alternate Erase | |
| 154 | SysReq/Attention | |
| 155 | Cancel | |
| 156 | Clear | |
| 157 | Prior | |
| 158 | Return | |
| 159 | Separator | |
| 160 | Out | |
| 161 | Oper | |
| 162 | Clear/Again | |
| 163 | CrSel/Props | |
| 164 | ExSel | |
| 165–175 | Reserved | |
| 176 | Keypad 00 | |
| 177 | Keypad 000 | |
| 178 | Thousands Separator | |
| 179 | Decimal Separator | |
| 180 | Currency Unit | |
| 181 | Currency Sub-unit | |
| 182 | Keypad ( | |
| 183 | Keypad ) | |
| 184 | Keypad { | |
| 185 | Keypad } | |
| 186 | Keypad Tab | |
| 187 | Keypad Backspace | |
| 188 | Keypad A | |
| 189 | Keypad B | |
| 190 | Keypad C | |
| 191 | Keypad D | |
| 192 | Keypad E | |
| 193 | Keypad F | |
| 194 | Keypad XOR | |
| 195 | Keypad ^ | |
| 196 | Keypad % | |
| 197 | Keypad < | |
| 198 | Keypad > | |
| 199 | Keypad & | |
| 200 | Keypad && | |
| 201 | Keypad | | |
| 202 | Keypad || | |
| 203 | Keypad : | |
| 204 | Keypad # | |
| 205 | Keypad Space | |
| 206 | Keypad @ | |
| 207 | Keypad ! | |
| 208 | Keypad Memory Store | |
| 209 | Keypad Memory Recall | |
| 210 | Keypad Memory Clear | |
| 211 | Keypad Memory Add | |
| 212 | Keypad Memory Subtract | |
| 213 | Keypad Memory Multiply | |
| 214 | Keypad Memory Divide | |
| 215 | Keypad +/- | |
| 216 | Keypad Clear | |
| 217 | Keypad Clear Entry | |
| 218 | Keypad Binary | |
| 219 | Keypad Octal | |
| 220 | Keypad Decimal | |
| 221 | Keypad Hexadecimal | |
| 222–223 | Reserved | |
| 224 | ctr-l | Left Control |
| 225 | shift-l | Left Shift |
| 226 | alt-l | Left Alt |
| 227 | gui-l | Left GUI |
| 228 | ctr-r | Right Control |
| 229 | shift-r | Right Shift |
| 230 | alt-r | Right Alt |
| 231 | gui-r | Right GUI |
| 232–253 | Reserved | |
| 254 | help | Reserved |
| 255 | Reserved |
The key numbers and names come from the Keyboard/Keypad page (section 10) of the USB HID Usage Tables 1.5 document.