Introduction

Direct Input Keyboard (DIK) codes are an industry standard of recognizing keystrokes.

To use the predefined DIK names, have the following include statement in your script or config:

#include "\vbs2\headers\dikCodes.hpp"

Be aware that some of the special codes (e.g. [Calculator]) may not be interpreted by VBS2, and will not have an effect if used in commands.

Codes

DIK Name Key pressed Hex. code Dec. code Notes
DIK_ESCAPE [Esc] 0x01 1
DIK_1 [1] 0x02 2
DIK_2 [2] 0x03 3
DIK_3 [3] 0x04 4
DIK_4 [4] 0x05 5
DIK_5 [5] 0x06 6
DIK_6 [6] 0x07 7
DIK_7 [7] 0x08 8
DIK_8 [8] 0x09 9
DIK_9 [9] 0x0A 10
DIK_0 [0] 0x0B 11
DIK_MINUS [-] 0x0C 12 [-] on main keyboard
DIK_EQUALS [=] 0x0D 13
DIK_BACK [Back] 0x0E 14 [Backspace]
DIK_TAB [Tab] 0x0F 15
DIK_Q [Q] 0x10 16
DIK_W [W] 0x11 17
DIK_E [E] 0x12 18
DIK_R [R] 0x13 19
DIK_T [T] 0x14 20
DIK_Y [Y] 0x15 21
DIK_U [U] 0x16 22
DIK_I [I] 0x17 23
DIK_O [O] 0x18 24
DIK_P [P] 0x19 25
DIK_LBRACKET [['] 0x1A 26
DIK_RBRACKET [']] 0x1B 27
DIK_RETURN [Return] 0x1C 28 [Enter] on main keyboard
DIK_LCONTROL [L Ctrl] 0x1D 29
DIK_A [A] 0x1E 30
DIK_S [S] 0x1F 31
DIK_D [D] 0x20 32
DIK_F [F] 0x21 33
DIK_G [G] 0x22 34
DIK_H [H] 0x23 35
DIK_J [J] 0x24 36
DIK_K [K] 0x25 37
DIK_L [L] 0x26 38
DIK_SEMICOLON [;] 0x27 39
DIK_APOSTROPHE [''] 0x28 40
DIK_GRAVE [`] 0x29 41 accent grave
DIK_LSHIFT [L Shift] 0x2A 42
DIK_BACKSLASH [Backslash] 0x2B 43
DIK_Z [Z] 0x2C 44
DIK_X [X] 0x2D 45
DIK_C [C] 0x2E 46
DIK_V [V] 0x2F 47
DIK_B [B] 0x30 48
DIK_N [N] 0x31 49
DIK_M [M] 0x32 50
DIK_COMMA [,] 0x33 51
DIK_PERIOD [.] 0x34 52 [.] on main keyboard
DIK_SLASH [/] 0x35 53 [/] on main keyboard
DIK_RSHIFT [R Shift] 0x36 54
DIK_MULTIPLY [*] 0x37 55 [*] on numeric keypad
DIK_LMENU [L Alt] 0x38 56 left [Alt]
DIK_SPACE [Space] 0x39 57
DIK_CAPITAL [CapsLock] 0x3A 58
DIK_F1 [F1] 0x3B 59
DIK_F2 [F2] 0x3C 60
DIK_F3 [F3] 0x3D 61
DIK_F4 [F4] 0x3E 62
DIK_F5 [F5] 0x3F 63
DIK_F6 [F6] 0x40 64
DIK_F7 [F7] 0x41 65
DIK_F8 [F8] 0x42 66
DIK_F9 [F9] 0x43 67
DIK_F10 [F10] 0x44 68
DIK_NUMLOCK [NumLock] 0x45 69
DIK_SCROLL [ScrollLock] 0x46 70 [ScrLk]
DIK_NUMPAD7 [Num7] 0x47 71
DIK_NUMPAD8 [Num8] 0x48 72
DIK_NUMPAD9 [Num9] 0x49 73
DIK_SUBTRACT [Num-] 0x4A 74 [-] on numeric keypad
DIK_NUMPAD4 [Num4] 0x4B 75
DIK_NUMPAD5 [Num5] 0x4C 76
DIK_NUMPAD6 [Num6] 0x4D 77
DIK_ADD [Num+] 0x4E 78 [+] on numeric keypad
DIK_NUMPAD1 [Num1] 0x4F 79
DIK_NUMPAD2 [Num2] 0x50 80
DIK_NUMPAD3 [Num3] 0x51 81
DIK_NUMPAD0 [Num0] 0x52 82
DIK_DECIMAL [Num.] 0x53 83 [.] on numeric keypad
DIK_OEM_102 [OEM_102" 0x56 86 ] on RT 102-key keyboard (Non-U.S.)
DIK_F11 [F11] 0x57 87
DIK_F12 [F12] 0x58 88
DIK_F13 [pc-98 F13] 0x64 100 (NEC PC98)
DIK_F14 [pc-98 F14] 0x65 101 (NEC PC98)
DIK_F15 [pc-98 F15] 0x66 102 (NEC PC98)
DIK_KANA [jKana] 0x70 112 (Japanese keyboard)
DIK_ABNT C1 [bzAbnt_C1] 0x73 115 [/?] on Brazilian keyboard
DIK_CONVERT [jConvert] 0x79 121 (Japanese keyboard)
DIK_NOCONVERT [jNoConvert] 0x7B 123 (Japanese keyboard)
DIK_YEN [jYen] 0x7D 125 (Japanese keyboard)
DIK_ABNT_C2 [bzAbnt_C2] 0x7E 126 Numpad [.] on Brazilian keyboard
DIK_NUMPADEQUALS [Num=] 0x8D 141 [=] on numeric keypad (NEC PC98)
DIK_PREVTRACK [Prev] 0x90 144 Previous Track (DIK_CIRCUMFLEX on Japanese keyboard)
DIK_AT [pc-98 @] 0x91 145 (NEC PC98)
DIK_COLON [pc-98 :] 0x92 146 (NEC PC98)
DIK_UNDERLINE [pc-98 _] 0x93 147 (NEC PC98)
DIK_KANJI [jKanji] 0x94 148 (Japanese keyboard)
DIK_STOP [pc-98 Stop] 0x95 149 (NEC PC98)
DIK_AX [jAX] 0x96 150 (Japan AX)
DIK_NEXTTRACK [Next] 0x99 153 Next Track
DIK_NUMPADENTER [NumEnter] 0x9C 156 [Enter] on numeric keypad
DIK_RCONTROL [R Ctrl] 0x9D 157
DIK_MUTE [Mute] 0xA0 160 Mute
DIK_CALCULATOR [Calc] 0xA1 161 Calculator
DIK_PLAYPAUSE [Play/Pause] 0xA2 162 Play / Pause
DIK_MEDIASTOP [Stop] 0xA4 164 Media Stop
DIK_VOLUMEDOWN [Vol-] 0xAE 174 Volume -
DIK_VOLUMEUP [Vol+] 0xB0 176 Volume +
DIK_WEBHOME [webHome] 0xB2 178 Web home
DIK_NUMPADCOMMA [Num,] 0xB3 179 [,] on numeric keypad (NEC PC98)
DIK_DIVIDE [Num/] 0xB5 181 [/] on numeric keypad
DIK_SYSRQ [SysRq] 0xB7 183
DIK_RMENU [R Alt] 0xB8 184 right [Alt]
DIK_PAUSE [Pause] 0xC5 197 Pause
DIK_HOME [Home] 0xC7 199 [Home] on arrow keypad
DIK_UP [Up Arrow] 0xC8 200 [UpArrow] on arrow keypad
DIK_PRIOR [PgUp] 0xC9 201 [PgUp] on arrow keypad
DIK_LEFT [Left Arrow] 0xCB 203 [LeftArrow] on arrow keypad
DIK_RIGHT [Right Arrow] 0xCD 205 [RightArrow] on arrow keypad
DIK_END [End] 0xCF 207 [End] on arrow keypad
DIK_DOWN [Down Arrow] 0xD0 208 [DownArrow] on arrow keypad
DIK_NEXT [PgDn] 0xD1 209 [PgDn] on arrow keypad
DIK_INSERT [Ins] 0xD2 210 [Insert] on arrow keypad
DIK_DELETE [Del] 0xD3 211 [Delete] on arrow keypad
DIK_LWIN [L Win] 0xDB 219 Left Windows key
DIK_RWIN [R Win] 0xDC 220 Right Windows key
DIK_APPS [App Menu] 0xDD 221 AppMenu key
DIK_POWER [Power] 0xDE 222 System Power
DIK_SLEEP [Sleep] 0xDF 223 System Sleep
DIK_WAKE [Wake] 0xE3 227 System Wake
DIK_WEBSEARCH [webSearch] 0xE5 229 Web Search
DIK_WEBFAVORITES [webFavs] 0xE6 230 Web Favorites
DIK_WEBREFRESH [webRefresh] 0xE7 231 Web Refresh
DIK_WEBSTOP [webStop] 0xE8 232 Web Stop
DIK_WEBFORWARD [webForward] 0xE9 233 Web Forward
DIK_WEBBACK [webBack] 0xEA 234 Web Back
DIK_MYCOMPUTER [My Computer] 0xEB 235 My Computer
DIK_MAIL [Mail] 0xEC 236 Mail
DIK_MEDIASELECT [Media Select] 0xED 237 Media Select