WindowsKeyboardCodes.h 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321
  1. /*
  2. * Copyright (C) 2010 Apple Inc. All rights reserved.
  3. *
  4. * Redistribution and use in source and binary forms, with or without
  5. * modification, are permitted provided that the following conditions
  6. * are met:
  7. * 1. Redistributions of source code must retain the above copyright
  8. * notice, this list of conditions and the following disclaimer.
  9. * 2. Redistributions in binary form must reproduce the above copyright
  10. * notice, this list of conditions and the following disclaimer in the
  11. * documentation and/or other materials provided with the distribution.
  12. *
  13. * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS "AS IS"
  14. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
  15. * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  16. * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
  17. * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  18. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  19. * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  20. * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  21. * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  22. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  23. * THE POSSIBILITY OF SUCH DAMAGE.
  24. */
  25. #ifndef VK_UNKNOWN
  26. #define VK_UNKNOWN 0
  27. // Left mouse button
  28. // Right mouse button
  29. // Control-break processing
  30. // Middle mouse button (three-button mouse)
  31. // VK_XBUTTON1 (05)
  32. // VK_XBUTTON2 (06)
  33. #ifndef VK_BACK
  34. #define VK_BACK 0x08
  35. #endif
  36. #ifndef VK_TAB
  37. #define VK_TAB 0x09
  38. #endif
  39. #ifndef VK_CLEAR
  40. #define VK_CLEAR 0x0C
  41. #endif
  42. #ifndef VK_RETURN
  43. #define VK_RETURN 0x0D
  44. #endif
  45. #ifndef VK_SHIFT
  46. #define VK_SHIFT 0x10
  47. #endif
  48. #ifndef VK_CONTROL
  49. #define VK_CONTROL 0x11 // CTRL key
  50. #endif
  51. #ifndef VK_MENU
  52. #define VK_MENU 0x12 // ALT key
  53. #endif
  54. #ifndef VK_PAUSE
  55. #define VK_PAUSE 0x13 // PAUSE key
  56. #endif
  57. #ifndef VK_CAPITAL
  58. #define VK_CAPITAL 0x14 // CAPS LOCK key
  59. #endif
  60. #ifndef VK_KANA
  61. #define VK_KANA 0x15 // Input Method Editor (IME) Kana mode
  62. #endif
  63. #ifndef VK_HANGUL
  64. #define VK_HANGUL 0x15 // IME Hangul mode
  65. #endif
  66. #ifndef VK_JUNJA
  67. #define VK_JUNJA 0x17 // IME Junja mode
  68. #endif
  69. #ifndef VK_FINAL
  70. #define VK_FINAL 0x18 // IME final mode
  71. #endif
  72. #ifndef VK_HANJA
  73. #define VK_HANJA 0x19 // IME Hanja mode
  74. #endif
  75. #ifndef VK_KANJI
  76. #define VK_KANJI 0x19 // IME Kanji mode
  77. #endif
  78. #ifndef VK_ESCAPE
  79. #define VK_ESCAPE 0x1B // ESC key
  80. #endif
  81. #ifndef VK_CONVERT
  82. #define VK_CONVERT 0x1C // IME convert
  83. #endif
  84. #ifndef VK_NONCONVERT
  85. #define VK_NONCONVERT 0x1D // IME nonconvert
  86. #endif
  87. #ifndef VK_ACCEPT
  88. #define VK_ACCEPT 0x1E // IME accept
  89. #endif
  90. #ifndef VK_MODECHANGE
  91. #define VK_MODECHANGE 0x1F // IME mode change request
  92. #endif
  93. #ifndef VK_SPACE
  94. #define VK_SPACE 0x20 // SPACE key
  95. #endif
  96. #ifndef VK_PRIOR
  97. #define VK_PRIOR 0x21 // PAGE UP key
  98. #endif
  99. #ifndef VK_NEXT
  100. #define VK_NEXT 0x22 // PAGE DOWN key
  101. #endif
  102. #ifndef VK_END
  103. #define VK_END 0x23 // END key
  104. #endif
  105. #ifndef VK_HOME
  106. #define VK_HOME 0x24 // HOME key
  107. #endif
  108. #ifndef VK_LEFT
  109. #define VK_LEFT 0x25 // LEFT ARROW key
  110. #endif
  111. #ifndef VK_UP
  112. #define VK_UP 0x26 // UP ARROW key
  113. #endif
  114. #ifndef VK_RIGHT
  115. #define VK_RIGHT 0x27 // RIGHT ARROW key
  116. #endif
  117. #ifndef VK_DOWN
  118. #define VK_DOWN 0x28 // DOWN ARROW key
  119. #endif
  120. #ifndef VK_SELECT
  121. #define VK_SELECT 0x29 // SELECT key
  122. #endif
  123. #ifndef VK_PRINT
  124. #define VK_PRINT 0x2A // PRINT key
  125. #endif
  126. #ifndef VK_EXECUTE
  127. #define VK_EXECUTE 0x2B // EXECUTE key
  128. #endif
  129. #ifndef VK_SNAPSHOT
  130. #define VK_SNAPSHOT 0x2C // PRINT SCREEN key
  131. #endif
  132. #ifndef VK_INSERT
  133. #define VK_INSERT 0x2D // INS key
  134. #endif
  135. #ifndef VK_DELETE
  136. #define VK_DELETE 0x2E // DEL key
  137. #endif
  138. #ifndef VK_HELP
  139. #define VK_HELP 0x2F // HELP key
  140. #endif
  141. #define VK_0 0x30
  142. #define VK_1 0x31
  143. #define VK_2 0x32
  144. #define VK_3 0x33
  145. #define VK_4 0x34
  146. #define VK_5 0x35
  147. #define VK_6 0x36
  148. #define VK_7 0x37
  149. #define VK_8 0x38
  150. #define VK_9 0x39
  151. #define VK_A 0x41
  152. #define VK_B 0x42
  153. #define VK_C 0x43
  154. #define VK_D 0x44
  155. #define VK_E 0x45
  156. #define VK_F 0x46
  157. #define VK_G 0x47
  158. #define VK_H 0x48
  159. #define VK_I 0x49
  160. #define VK_J 0x4A
  161. #define VK_K 0x4B
  162. #define VK_L 0x4C
  163. #define VK_M 0x4D
  164. #define VK_N 0x4E
  165. #define VK_O 0x4F
  166. #define VK_P 0x50
  167. #define VK_Q 0x51
  168. #define VK_R 0x52
  169. #define VK_S 0x53
  170. #define VK_T 0x54
  171. #define VK_U 0x55
  172. #define VK_V 0x56
  173. #define VK_W 0x57
  174. #define VK_X 0x58
  175. #define VK_Y 0x59
  176. #define VK_Z 0x5A
  177. #define VK_LWIN 0x5B // Left Windows key (Microsoft Natural keyboard)
  178. #define VK_RWIN 0x5C // Right Windows key (Natural keyboard)
  179. #define VK_APPS 0x5D // Applications key (Natural keyboard)
  180. #define VK_SLEEP 0x5F // Computer Sleep key
  181. // Num pad keys
  182. #define VK_NUMPAD0 0x60
  183. #define VK_NUMPAD1 0x61
  184. #define VK_NUMPAD2 0x62
  185. #define VK_NUMPAD3 0x63
  186. #define VK_NUMPAD4 0x64
  187. #define VK_NUMPAD5 0x65
  188. #define VK_NUMPAD6 0x66
  189. #define VK_NUMPAD7 0x67
  190. #define VK_NUMPAD8 0x68
  191. #define VK_NUMPAD9 0x69
  192. #define VK_MULTIPLY 0x6A
  193. #define VK_ADD 0x6B
  194. #define VK_SEPARATOR 0x6C
  195. #define VK_SUBTRACT 0x6D
  196. #define VK_DECIMAL 0x6E
  197. #define VK_DIVIDE 0x6F
  198. #define VK_F1 0x70
  199. #define VK_F2 0x71
  200. #define VK_F3 0x72
  201. #define VK_F4 0x73
  202. #define VK_F5 0x74
  203. #define VK_F6 0x75
  204. #define VK_F7 0x76
  205. #define VK_F8 0x77
  206. #define VK_F9 0x78
  207. #define VK_F10 0x79
  208. #define VK_F11 0x7A
  209. #define VK_F12 0x7B
  210. #define VK_F13 0x7C
  211. #define VK_F14 0x7D
  212. #define VK_F15 0x7E
  213. #define VK_F16 0x7F
  214. #define VK_F17 0x80
  215. #define VK_F18 0x81
  216. #define VK_F19 0x82
  217. #define VK_F20 0x83
  218. #define VK_F21 0x84
  219. #define VK_F22 0x85
  220. #define VK_F23 0x86
  221. #define VK_F24 0x87
  222. #define VK_NUMLOCK 0x90
  223. #define VK_SCROLL 0x91
  224. #define VK_LSHIFT 0xA0
  225. #define VK_RSHIFT 0xA1
  226. #define VK_LCONTROL 0xA2
  227. #define VK_RCONTROL 0xA3
  228. #define VK_LMENU 0xA4
  229. #define VK_RMENU 0xA5
  230. #define VK_BROWSER_BACK 0xA6 // Windows 2000/XP: Browser Back key
  231. #define VK_BROWSER_FORWARD 0xA7 // Windows 2000/XP: Browser Forward key
  232. #define VK_BROWSER_REFRESH 0xA8 // Windows 2000/XP: Browser Refresh key
  233. #define VK_BROWSER_STOP 0xA9 // Windows 2000/XP: Browser Stop key
  234. #define VK_BROWSER_SEARCH 0xAA // Windows 2000/XP: Browser Search key
  235. #define VK_BROWSER_FAVORITES 0xAB // Windows 2000/XP: Browser Favorites key
  236. #define VK_BROWSER_HOME 0xAC // Windows 2000/XP: Browser Start and Home key
  237. #define VK_VOLUME_MUTE 0xAD // Windows 2000/XP: Volume Mute key
  238. #define VK_VOLUME_DOWN 0xAE // Windows 2000/XP: Volume Down key
  239. #define VK_VOLUME_UP 0xAF // Windows 2000/XP: Volume Up key
  240. #define VK_MEDIA_NEXT_TRACK 0xB0 // Windows 2000/XP: Next Track key
  241. #define VK_MEDIA_PREV_TRACK 0xB1 // Windows 2000/XP: Previous Track key
  242. #define VK_MEDIA_STOP 0xB2 // Windows 2000/XP: Stop Media key
  243. #define VK_MEDIA_PLAY_PAUSE 0xB3 // Windows 2000/XP: Play/Pause Media key
  244. #define VK_MEDIA_LAUNCH_MAIL 0xB4 // Windows 2000/XP: Start Mail key
  245. #define VK_MEDIA_LAUNCH_MEDIA_SELECT 0xB5 // Windows 2000/XP: Select Media key
  246. #define VK_MEDIA_LAUNCH_APP1 0xB6 // VK_LAUNCH_APP1 (B6) Windows 2000/XP: Start Application 1 key
  247. #define VK_MEDIA_LAUNCH_APP2 0xB7 // VK_LAUNCH_APP2 (B7) Windows 2000/XP: Start Application 2 key
  248. // VK_OEM_1 (BA) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the ';:' key
  249. #define VK_OEM_1 0xBA
  250. // Windows 2000/XP: For any country/region, the '+' key
  251. #define VK_OEM_PLUS 0xBB
  252. // Windows 2000/XP: For any country/region, the ',' key
  253. #define VK_OEM_COMMA 0xBC
  254. // Windows 2000/XP: For any country/region, the '-' key
  255. #define VK_OEM_MINUS 0xBD
  256. // Windows 2000/XP: For any country/region, the '.' key
  257. #define VK_OEM_PERIOD 0xBE
  258. // VK_OEM_2 (BF) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the '/?' key
  259. #define VK_OEM_2 0xBF
  260. // VK_OEM_3 (C0) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the '`~' key
  261. #define VK_OEM_3 0xC0
  262. // VK_OEM_4 (DB) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the '[{' key
  263. #define VK_OEM_4 0xDB
  264. // VK_OEM_5 (DC) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the '\|' key
  265. #define VK_OEM_5 0xDC
  266. // VK_OEM_6 (DD) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the ']}' key
  267. #define VK_OEM_6 0xDD
  268. // VK_OEM_7 (DE) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the 'single-quote/double-quote' key
  269. #define VK_OEM_7 0xDE
  270. // VK_OEM_8 (DF) Used for miscellaneous characters; it can vary by keyboard.
  271. #define VK_OEM_8 0xDF
  272. // VK_OEM_102 (E2) Windows 2000/XP: Either the angle bracket key or the backslash key on the RT 102-key keyboard
  273. #define VK_OEM_102 0xE2
  274. // Windows 95/98/Me, Windows NT 4.0, Windows 2000/XP: IME PROCESS key
  275. #define VK_PROCESSKEY 0xE5
  276. // Windows 2000/XP: Used to pass Unicode characters as if they were keystrokes. The VK_PACKET key is the low word of a 32-bit Virtual Key value used for non-keyboard input methods. For more information, see Remark in KEYBDINPUT,SendInput, WM_KEYDOWN, and WM_KEYUP
  277. #define VK_PACKET 0xE7
  278. #define VK_ATTN 0xF6 // Attn key
  279. #define VK_CRSEL 0xF7 // CrSel key
  280. #define VK_EXSEL 0xF8 // ExSel key
  281. #define VK_EREOF 0xF9 // Erase EOF key
  282. #define VK_PLAY 0xFA // Play key
  283. #define VK_ZOOM 0xFB // Zoom key
  284. #define VK_NONAME 0xFC // Reserved for future use
  285. #define VK_PA1 0xFD // VK_PA1 (FD) PA1 key
  286. #define VK_OEM_CLEAR 0xFE // Clear key
  287. #endif // VK_UNKNOWN