00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef _CEGUIInputEvent_h_
00031 #define _CEGUIInputEvent_h_
00032
00033 #include "CEGUIBase.h"
00034 #include "CEGUIEventArgs.h"
00035 #include "CEGUIString.h"
00036 #include "CEGUIVector.h"
00037
00038
00039
00040 namespace CEGUI
00041 {
00046 struct CEGUIEXPORT Key
00047 {
00048
00049 enum Scan
00050 {
00051 Escape =0x01,
00052 One =0x02,
00053 Two =0x03,
00054 Three =0x04,
00055 Four =0x05,
00056 Five =0x06,
00057 Six =0x07,
00058 Seven =0x08,
00059 Eight =0x09,
00060 Nine =0x0A,
00061 Zero =0x0B,
00062 Minus =0x0C,
00063 Equals =0x0D,
00064 Backspace =0x0E,
00065 Tab =0x0F,
00066 Q =0x10,
00067 W =0x11,
00068 E =0x12,
00069 R =0x13,
00070 T =0x14,
00071 Y =0x15,
00072 U =0x16,
00073 I =0x17,
00074 O =0x18,
00075 P =0x19,
00076 LeftBracket =0x1A,
00077 RightBracket =0x1B,
00078 Return =0x1C,
00079 LeftControl =0x1D,
00080 A =0x1E,
00081 S =0x1F,
00082 D =0x20,
00083 F =0x21,
00084 G =0x22,
00085 H =0x23,
00086 J =0x24,
00087 K =0x25,
00088 L =0x26,
00089 Semicolon =0x27,
00090 Apostrophe =0x28,
00091 Grave =0x29,
00092 LeftShift =0x2A,
00093 Backslash =0x2B,
00094 Z =0x2C,
00095 X =0x2D,
00096 C =0x2E,
00097 V =0x2F,
00098 B =0x30,
00099 N =0x31,
00100 M =0x32,
00101 Comma =0x33,
00102 Period =0x34,
00103 Slash =0x35,
00104 RightShift =0x36,
00105 Multiply =0x37,
00106 LeftAlt =0x38,
00107 Space =0x39,
00108 Capital =0x3A,
00109 F1 =0x3B,
00110 F2 =0x3C,
00111 F3 =0x3D,
00112 F4 =0x3E,
00113 F5 =0x3F,
00114 F6 =0x40,
00115 F7 =0x41,
00116 F8 =0x42,
00117 F9 =0x43,
00118 F10 =0x44,
00119 NumLock =0x45,
00120 ScrollLock =0x46,
00121 Numpad7 =0x47,
00122 Numpad8 =0x48,
00123 Numpad9 =0x49,
00124 Subtract =0x4A,
00125 Numpad4 =0x4B,
00126 Numpad5 =0x4C,
00127 Numpad6 =0x4D,
00128 Add =0x4E,
00129 Numpad1 =0x4F,
00130 Numpad2 =0x50,
00131 Numpad3 =0x51,
00132 Numpad0 =0x52,
00133 Decimal =0x53,
00134 OEM_102 =0x56,
00135 F11 =0x57,
00136 F12 =0x58,
00137 F13 =0x64,
00138 F14 =0x65,
00139 F15 =0x66,
00140 Kana =0x70,
00141 ABNT_C1 =0x73,
00142 Convert =0x79,
00143 NoConvert =0x7B,
00144 Yen =0x7D,
00145 ABNT_C2 =0x7E,
00146 NumpadEquals =0x8D,
00147 PrevTrack =0x90,
00148 At =0x91,
00149 Colon =0x92,
00150 Underline =0x93,
00151 Kanji =0x94,
00152 Stop =0x95,
00153 AX =0x96,
00154 Unlabeled =0x97,
00155 NextTrack =0x99,
00156 NumpadEnter =0x9C,
00157 RightControl =0x9D,
00158 Mute =0xA0,
00159 Calculator =0xA1,
00160 PlayPause =0xA2,
00161 MediaStop =0xA4,
00162 VolumeDown =0xAE,
00163 VolumeUp =0xB0,
00164 WebHome =0xB2,
00165 NumpadComma =0xB3,
00166 Divide =0xB5,
00167 SysRq =0xB7,
00168 RightAlt =0xB8,
00169 Pause =0xC5,
00170 Home =0xC7,
00171 ArrowUp =0xC8,
00172 PageUp =0xC9,
00173 ArrowLeft =0xCB,
00174 ArrowRight =0xCD,
00175 End =0xCF,
00176 ArrowDown =0xD0,
00177 PageDown =0xD1,
00178 Insert =0xD2,
00179 Delete =0xD3,
00180 LeftWindows =0xDB,
00181 RightWindows =0xDC,
00182 AppMenu =0xDD,
00183 Power =0xDE,
00184 Sleep =0xDF,
00185 Wake =0xE3,
00186 WebSearch =0xE5,
00187 WebFavorites =0xE6,
00188 WebRefresh =0xE7,
00189 WebStop =0xE8,
00190 WebForward =0xE9,
00191 WebBack =0xEA,
00192 MyComputer =0xEB,
00193 Mail =0xEC,
00194 MediaSelect =0xED
00195 };
00196
00197 };
00198
00199
00204 enum MouseButton
00205 {
00207 LeftButton,
00209 RightButton,
00211 MiddleButton,
00213 X1Button,
00215 X2Button,
00217 MouseButtonCount,
00219 NoButton
00220 };
00221
00222
00227 enum SystemKey
00228 {
00229 LeftMouse = 0x0001,
00230 RightMouse = 0x0002,
00231 Shift = 0x0004,
00232 Control = 0x0008,
00233 MiddleMouse = 0x0010,
00234 X1Mouse = 0x0020,
00235 X2Mouse = 0x0040,
00236 Alt = 0x0080
00237 };
00238
00239
00245 class CEGUIEXPORT WindowEventArgs : public EventArgs
00246 {
00247 public:
00248 WindowEventArgs(Window* wnd) : window(wnd) {}
00249
00250 Window* window;
00251 };
00252
00257 class CEGUIEXPORT UpdateEventArgs : public WindowEventArgs
00258 {
00259 public:
00260 UpdateEventArgs(Window* window, float tslf) :
00261 WindowEventArgs(window),
00262 d_timeSinceLastFrame(tslf)
00263 {}
00264
00265 float d_timeSinceLastFrame;
00266 };
00267
00268
00274 class CEGUIEXPORT MouseEventArgs : public WindowEventArgs
00275 {
00276 public:
00277 MouseEventArgs(Window* wnd) : WindowEventArgs(wnd) {}
00278
00279 Point position;
00280 Vector2 moveDelta;
00281 MouseButton button;
00282 uint sysKeys;
00283 float wheelChange;
00284 uint clickCount;
00285 };
00286
00287
00293 class CEGUIEXPORT MouseCursorEventArgs : public EventArgs
00294 {
00295 public:
00296 MouseCursorEventArgs(MouseCursor* cursor) : mouseCursor(cursor) {}
00297
00298 MouseCursor* mouseCursor;
00299 const Image* image;
00300 };
00301
00302
00308 class CEGUIEXPORT KeyEventArgs : public WindowEventArgs
00309 {
00310 public:
00311 KeyEventArgs(Window* wnd) : WindowEventArgs(wnd) {}
00312
00313 utf32 codepoint;
00314 Key::Scan scancode;
00315 uint sysKeys;
00316 };
00317
00318
00323 class CEGUIEXPORT ActivationEventArgs : public WindowEventArgs
00324 {
00325 public:
00326 ActivationEventArgs(Window* wnd) : WindowEventArgs(wnd) {}
00327
00328 Window* otherWindow;
00329 };
00330
00335 class CEGUIEXPORT DragDropEventArgs : public WindowEventArgs
00336 {
00337 public:
00338 DragDropEventArgs(Window* wnd) : WindowEventArgs(wnd) {}
00339 DragContainer* dragDropItem;
00340 };
00341
00347 class CEGUIEXPORT DisplayEventArgs : public EventArgs
00348 {
00349 public:
00350 DisplayEventArgs(const Size& sz) : size(sz) {}
00351
00353 Size size;
00354 };
00355
00357 class CEGUIEXPORT ResourceEventArgs : public EventArgs
00358 {
00359 public:
00360 ResourceEventArgs(const String& type, const String& name) :
00361 resourceType(type),
00362 resourceName(name)
00363 {}
00364
00366 String resourceType;
00368 String resourceName;
00369 };
00370
00371
00372 }
00373
00374
00375 #endif // end of guard _CEGUIInputEvent_h_