Input.h 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275
  1. /*
  2. * This source file is part of libRocket, the HTML/CSS Interface Middleware
  3. *
  4. * For the latest information, see http://www.librocket.com
  5. *
  6. * Copyright (c) 2008-2010 CodePoint Ltd, Shift Technology Ltd
  7. *
  8. * Permission is hereby granted, free of charge, to any person obtaining a copy
  9. * of this software and associated documentation files (the "Software"), to deal
  10. * in the Software without restriction, including without limitation the rights
  11. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  12. * copies of the Software, and to permit persons to whom the Software is
  13. * furnished to do so, subject to the following conditions:
  14. *
  15. * The above copyright notice and this permission notice shall be included in
  16. * all copies or substantial portions of the Software.
  17. *
  18. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  19. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  20. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  21. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  22. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  23. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  24. * THE SOFTWARE.
  25. *
  26. */
  27. #ifndef ROCKETCOREINPUT_H
  28. #define ROCKETCOREINPUT_H
  29. namespace Rocket {
  30. namespace Core {
  31. /*
  32. Enumerants for sending input events into Rocket.
  33. @author Peter Curry
  34. */
  35. namespace Input
  36. {
  37. enum KeyIdentifier
  38. {
  39. KI_UNKNOWN = 0,
  40. KI_SPACE = 1,
  41. KI_0 = 2,
  42. KI_1 = 3,
  43. KI_2 = 4,
  44. KI_3 = 5,
  45. KI_4 = 6,
  46. KI_5 = 7,
  47. KI_6 = 8,
  48. KI_7 = 9,
  49. KI_8 = 10,
  50. KI_9 = 11,
  51. KI_A = 12,
  52. KI_B = 13,
  53. KI_C = 14,
  54. KI_D = 15,
  55. KI_E = 16,
  56. KI_F = 17,
  57. KI_G = 18,
  58. KI_H = 19,
  59. KI_I = 20,
  60. KI_J = 21,
  61. KI_K = 22,
  62. KI_L = 23,
  63. KI_M = 24,
  64. KI_N = 25,
  65. KI_O = 26,
  66. KI_P = 27,
  67. KI_Q = 28,
  68. KI_R = 29,
  69. KI_S = 30,
  70. KI_T = 31,
  71. KI_U = 32,
  72. KI_V = 33,
  73. KI_W = 34,
  74. KI_X = 35,
  75. KI_Y = 36,
  76. KI_Z = 37,
  77. KI_OEM_1 = 38, // US standard keyboard; the ';:' key.
  78. KI_OEM_PLUS = 39, // Any region; the '=+' key.
  79. KI_OEM_COMMA = 40, // Any region; the ',<' key.
  80. KI_OEM_MINUS = 41, // Any region; the '-_' key.
  81. KI_OEM_PERIOD = 42, // Any region; the '.>' key.
  82. KI_OEM_2 = 43, // Any region; the '/?' key.
  83. KI_OEM_3 = 44, // Any region; the '`~' key.
  84. KI_OEM_4 = 45, // US standard keyboard; the '[{' key.
  85. KI_OEM_5 = 46, // US standard keyboard; the '\|' key.
  86. KI_OEM_6 = 47, // US standard keyboard; the ']}' key.
  87. KI_OEM_7 = 48, // US standard keyboard; the ''"' key.
  88. KI_OEM_8 = 49,
  89. KI_OEM_102 = 50, // RT 102-key keyboard; the '<>' or '\|' key.
  90. KI_NUMPAD0 = 51,
  91. KI_NUMPAD1 = 52,
  92. KI_NUMPAD2 = 53,
  93. KI_NUMPAD3 = 54,
  94. KI_NUMPAD4 = 55,
  95. KI_NUMPAD5 = 56,
  96. KI_NUMPAD6 = 57,
  97. KI_NUMPAD7 = 58,
  98. KI_NUMPAD8 = 59,
  99. KI_NUMPAD9 = 60,
  100. KI_NUMPADENTER = 61,
  101. KI_MULTIPLY = 62, // Asterisk on the numeric keypad.
  102. KI_ADD = 63, // Plus on the numeric keypad.
  103. KI_SEPARATOR = 64,
  104. KI_SUBTRACT = 65, // Minus on the numeric keypad.
  105. KI_DECIMAL = 66, // Period on the numeric keypad.
  106. KI_DIVIDE = 67, // Forward Slash on the numeric keypad.
  107. /*
  108. * NEC PC-9800 kbd definitions
  109. */
  110. KI_OEM_NEC_EQUAL = 68, // Equals key on the numeric keypad.
  111. KI_BACK = 69, // Backspace key.
  112. KI_TAB = 70, // Tab key.
  113. KI_CLEAR = 71,
  114. KI_RETURN = 72,
  115. KI_PAUSE = 73,
  116. KI_CAPITAL = 74, // Capslock key.
  117. KI_KANA = 75, // IME Kana mode.
  118. KI_HANGUL = 76, // IME Hangul mode.
  119. KI_JUNJA = 77, // IME Junja mode.
  120. KI_FINAL = 78, // IME final mode.
  121. KI_HANJA = 79, // IME Hanja mode.
  122. KI_KANJI = 80, // IME Kanji mode.
  123. KI_ESCAPE = 81, // Escape key.
  124. KI_CONVERT = 82, // IME convert.
  125. KI_NONCONVERT = 83, // IME nonconvert.
  126. KI_ACCEPT = 84, // IME accept.
  127. KI_MODECHANGE = 85, // IME mode change request.
  128. KI_PRIOR = 86, // Page Up key.
  129. KI_NEXT = 87, // Page Down key.
  130. KI_END = 88,
  131. KI_HOME = 89,
  132. KI_LEFT = 90, // Left Arrow key.
  133. KI_UP = 91, // Up Arrow key.
  134. KI_RIGHT = 92, // Right Arrow key.
  135. KI_DOWN = 93, // Down Arrow key.
  136. KI_SELECT = 94,
  137. KI_PRINT = 95,
  138. KI_EXECUTE = 96,
  139. KI_SNAPSHOT = 97, // Print Screen key.
  140. KI_INSERT = 98,
  141. KI_DELETE = 99,
  142. KI_HELP = 100,
  143. KI_LWIN = 101, // Left Windows key.
  144. KI_RWIN = 102, // Right Windows key.
  145. KI_APPS = 103, // Applications key.
  146. KI_POWER = 104,
  147. KI_SLEEP = 105,
  148. KI_WAKE = 106,
  149. KI_F1 = 107,
  150. KI_F2 = 108,
  151. KI_F3 = 109,
  152. KI_F4 = 110,
  153. KI_F5 = 111,
  154. KI_F6 = 112,
  155. KI_F7 = 113,
  156. KI_F8 = 114,
  157. KI_F9 = 115,
  158. KI_F10 = 116,
  159. KI_F11 = 117,
  160. KI_F12 = 118,
  161. KI_F13 = 119,
  162. KI_F14 = 120,
  163. KI_F15 = 121,
  164. KI_F16 = 122,
  165. KI_F17 = 123,
  166. KI_F18 = 124,
  167. KI_F19 = 125,
  168. KI_F20 = 126,
  169. KI_F21 = 127,
  170. KI_F22 = 128,
  171. KI_F23 = 129,
  172. KI_F24 = 130,
  173. KI_NUMLOCK = 131, // Numlock key.
  174. KI_SCROLL = 132, // Scroll Lock key.
  175. /*
  176. * Fujitsu/OASYS kbd definitions
  177. */
  178. KI_OEM_FJ_JISHO = 133, // 'Dictionary' key.
  179. KI_OEM_FJ_MASSHOU = 134, // 'Unregister word' key.
  180. KI_OEM_FJ_TOUROKU = 135, // 'Register word' key.
  181. KI_OEM_FJ_LOYA = 136, // 'Left OYAYUBI' key.
  182. KI_OEM_FJ_ROYA = 137, // 'Right OYAYUBI' key.
  183. KI_LSHIFT = 138,
  184. KI_RSHIFT = 139,
  185. KI_LCONTROL = 140,
  186. KI_RCONTROL = 141,
  187. KI_LMENU = 142,
  188. KI_RMENU = 143,
  189. KI_BROWSER_BACK = 144,
  190. KI_BROWSER_FORWARD = 145,
  191. KI_BROWSER_REFRESH = 146,
  192. KI_BROWSER_STOP = 147,
  193. KI_BROWSER_SEARCH = 148,
  194. KI_BROWSER_FAVORITES = 149,
  195. KI_BROWSER_HOME = 150,
  196. KI_VOLUME_MUTE = 151,
  197. KI_VOLUME_DOWN = 152,
  198. KI_VOLUME_UP = 153,
  199. KI_MEDIA_NEXT_TRACK = 154,
  200. KI_MEDIA_PREV_TRACK = 155,
  201. KI_MEDIA_STOP = 156,
  202. KI_MEDIA_PLAY_PAUSE = 157,
  203. KI_LAUNCH_MAIL = 158,
  204. KI_LAUNCH_MEDIA_SELECT = 159,
  205. KI_LAUNCH_APP1 = 160,
  206. KI_LAUNCH_APP2 = 161,
  207. /*
  208. * Various extended or enhanced keyboards
  209. */
  210. KI_OEM_AX = 162,
  211. KI_ICO_HELP = 163,
  212. KI_ICO_00 = 164,
  213. KI_PROCESSKEY = 165, // IME Process key.
  214. KI_ICO_CLEAR = 166,
  215. KI_ATTN = 167,
  216. KI_CRSEL = 168,
  217. KI_EXSEL = 169,
  218. KI_EREOF = 170,
  219. KI_PLAY = 171,
  220. KI_ZOOM = 172,
  221. KI_PA1 = 173,
  222. KI_OEM_CLEAR = 174,
  223. KI_LMETA = 175,
  224. KI_RMETA = 176
  225. };
  226. enum KeyModifier
  227. {
  228. KM_CTRL = 1 << 0, // Set if at least one Ctrl key is depressed.
  229. KM_SHIFT = 1 << 1, // Set if at least one Shift key is depressed.
  230. KM_ALT = 1 << 2, // Set if at least one Alt key is depressed.
  231. KM_META = 1 << 3, // Set if at least one Meta key (the command key) is depressed.
  232. KM_CAPSLOCK = 1 << 4, // Set if caps lock is enabled.
  233. KM_NUMLOCK = 1 << 5, // Set if num lock is enabled.
  234. KM_SCROLLLOCK = 1 << 6 // Set if scroll lock is enabled.
  235. };
  236. }
  237. }
  238. }
  239. #endif