InputEvents.h 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. //
  2. // Urho3D Engine
  3. // Copyright (c) 2008-2011 Lasse Öörni
  4. //
  5. // Permission is hereby granted, free of charge, to any person obtaining a copy
  6. // of this software and associated documentation files (the "Software"), to deal
  7. // in the Software without restriction, including without limitation the rights
  8. // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  9. // copies of the Software, and to permit persons to whom the Software is
  10. // furnished to do so, subject to the following conditions:
  11. //
  12. // The above copyright notice and this permission notice shall be included in
  13. // all copies or substantial portions of the Software.
  14. //
  15. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  18. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  20. // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  21. // THE SOFTWARE.
  22. //
  23. #pragma once
  24. #include "Object.h"
  25. /// Application activated
  26. EVENT(E_ACTIVATED, Activated)
  27. {
  28. }
  29. /// Application inactivated
  30. EVENT(E_INACTIVATED, Inactivated)
  31. {
  32. }
  33. /// Mouse button pressed
  34. EVENT(E_MOUSEBUTTONDOWN, MouseButtonDown)
  35. {
  36. PARAM(P_BUTTON, Button); // int
  37. PARAM(P_BUTTONS, Buttons); // int
  38. PARAM(P_QUALIFIERS, Qualifiers); // int
  39. }
  40. /// Mouse button released
  41. EVENT(E_MOUSEBUTTONUP, MouseButtonUp)
  42. {
  43. PARAM(P_BUTTON, Button); // int
  44. PARAM(P_BUTTONS, Buttons); // int
  45. PARAM(P_QUALIFIERS, Qualifiers); // int
  46. }
  47. /// Mouse moved
  48. EVENT(E_MOUSEMOVE, MouseMove)
  49. {
  50. PARAM(P_X, X); // int
  51. PARAM(P_Y, Y); // int
  52. PARAM(P_DX, DX); // int
  53. PARAM(P_DY, DY); // int
  54. PARAM(P_BUTTONS, Buttons); // int
  55. PARAM(P_QUALIFIERS, Qualifiers); // int
  56. PARAM(P_CLIPCURSOR, ClipCursor); // bool
  57. }
  58. /// Mouse wheel moved
  59. EVENT(E_MOUSEWHEEL, MouseWheel)
  60. {
  61. PARAM(P_WHEEL, Wheel); // int
  62. PARAM(P_BUTTONS, Buttons); // int
  63. PARAM(P_QUALIFIERS, Qualifiers); // int
  64. }
  65. /// Key pressed
  66. EVENT(E_KEYDOWN, KeyDown)
  67. {
  68. PARAM(P_KEY, Key); // int
  69. PARAM(P_BUTTONS, Buttons); // int
  70. PARAM(P_QUALIFIERS, Qualifiers); // int
  71. PARAM(P_REPEAT, Repeat); // bool
  72. }
  73. /// Key released
  74. EVENT(E_KEYUP, KeyUp)
  75. {
  76. PARAM(P_KEY, Key); // int
  77. PARAM(P_BUTTONS, Buttons); // int
  78. PARAM(P_QUALIFIERS, Qualifiers); // int
  79. }
  80. /// Character typed on the keyboard
  81. EVENT(E_CHAR, Char)
  82. {
  83. PARAM(P_CHAR, Char); // int
  84. PARAM(P_BUTTONS, Buttons); // int
  85. PARAM(P_QUALIFIERS, Qualifiers); // int
  86. }
  87. static const int MOUSEB_LEFT = 1;
  88. static const int MOUSEB_RIGHT = 2;
  89. static const int MOUSEB_MIDDLE = 4;
  90. static const int QUAL_SHIFT = 1;
  91. static const int QUAL_CTRL = 2;
  92. static const int QUAL_ALT = 4;
  93. static const int KEY_BACKSPACE = 0x08;
  94. static const int KEY_TAB = 0x09;
  95. static const int KEY_RETURN = 0x0d;
  96. static const int KEY_SHIFT = 0x10;
  97. static const int KEY_CTRL = 0x11;
  98. static const int KEY_ALT = 0x12;
  99. static const int KEY_PAUSE = 0x13;
  100. static const int KEY_CAPSLOCK = 0x14;
  101. static const int KEY_ESC = 0x1b;
  102. static const int KEY_SPACE = 0x20;
  103. static const int KEY_PAGEUP = 0x21;
  104. static const int KEY_PAGEDOWN = 0x22;
  105. static const int KEY_END = 0x23;
  106. static const int KEY_HOME = 0x24;
  107. static const int KEY_LEFT = 0x25;
  108. static const int KEY_UP = 0x26;
  109. static const int KEY_RIGHT = 0x27;
  110. static const int KEY_DOWN = 0x28;
  111. static const int KEY_SELECT = 0x29;
  112. static const int KEY_PRINTSCREEN = 0x2c;
  113. static const int KEY_INSERT = 0x2d;
  114. static const int KEY_DELETE = 0x2e;
  115. static const int KEY_LWIN = 0x5b;
  116. static const int KEY_RWIN = 0x5c;
  117. static const int KEY_APPS = 0x5d;
  118. static const int KEY_NUMPAD0 = 0x60;
  119. static const int KEY_NUMPAD1 = 0x61;
  120. static const int KEY_NUMPAD2 = 0x62;
  121. static const int KEY_NUMPAD3 = 0x63;
  122. static const int KEY_NUMPAD4 = 0x64;
  123. static const int KEY_NUMPAD5 = 0x65;
  124. static const int KEY_NUMPAD6 = 0x66;
  125. static const int KEY_NUMPAD7 = 0x67;
  126. static const int KEY_NUMPAD8 = 0x68;
  127. static const int KEY_NUMPAD9 = 0x69;
  128. static const int KEY_MULTIPLY = 0x6a;
  129. static const int KEY_ADD = 0x6b;
  130. static const int KEY_SUBTRACT = 0x6d;
  131. static const int KEY_DECIMAL = 0x6e;
  132. static const int KEY_DIVIDE = 0x6f;
  133. static const int KEY_F1 = 0x70;
  134. static const int KEY_F2 = 0x71;
  135. static const int KEY_F3 = 0x72;
  136. static const int KEY_F4 = 0x73;
  137. static const int KEY_F5 = 0x74;
  138. static const int KEY_F6 = 0x75;
  139. static const int KEY_F7 = 0x76;
  140. static const int KEY_F8 = 0x77;
  141. static const int KEY_F9 = 0x78;
  142. static const int KEY_F10 = 0x79;
  143. static const int KEY_F11 = 0x7a;
  144. static const int KEY_F12 = 0x7b;
  145. static const int KEY_F13 = 0x7c;
  146. static const int KEY_F14 = 0x7d;
  147. static const int KEY_F15 = 0x7e;
  148. static const int KEY_F16 = 0x7f;
  149. static const int KEY_F17 = 0x80;
  150. static const int KEY_F18 = 0x81;
  151. static const int KEY_F19 = 0x82;
  152. static const int KEY_F20 = 0x83;
  153. static const int KEY_F21 = 0x84;
  154. static const int KEY_F22 = 0x85;
  155. static const int KEY_F23 = 0x86;
  156. static const int KEY_F24 = 0x87;
  157. static const int KEY_NUMLOCK = 0x90;
  158. static const int KEY_SCROLLLOCK = 0x91;
  159. static const int KEY_LSHIFT = 0xa0;
  160. static const int KEY_RSHIFT = 0xa1;
  161. static const int KEY_LCTRL = 0xa2;
  162. static const int KEY_RCTRL = 0xa3;
  163. static const int KEY_LALT = 0xa4;
  164. static const int KEY_RALT = 0xa5;
  165. static const int KEY_OEM_1 = 0xba;
  166. static const int KEY_OEM_PLUS = 0xbb;
  167. static const int KEY_OEM_COMMA = 0xbc;
  168. static const int KEY_OEM_MINUS = 0xbd;
  169. static const int KEY_OEM_PERIOD = 0xbe;
  170. static const int KEY_OEM_2 = 0xbf;
  171. static const int KEY_OEM_3 = 0xc0;
  172. static const int KEY_OEM_4 = 0xdb;
  173. static const int KEY_OEM_5 = 0xdc;
  174. static const int KEY_OEM_6 = 0xdd;
  175. static const int KEY_OEM_7 = 0xde;
  176. static const int KEY_OEM_8 = 0xdf;