Crazy Eddie's GUI System  0.8.1
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
InputEvent.h
1 /***********************************************************************
2  filename: CEGUIInputEvent.h
3  created: 30/5/2004
4  author: Paul D Turner
5 
6  purpose: Defines interface to input event classes
7 *************************************************************************/
8 /***************************************************************************
9  * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
10  *
11  * Permission is hereby granted, free of charge, to any person obtaining
12  * a copy of this software and associated documentation files (the
13  * "Software"), to deal in the Software without restriction, including
14  * without limitation the rights to use, copy, modify, merge, publish,
15  * distribute, sublicense, and/or sell copies of the Software, and to
16  * permit persons to whom the Software is furnished to do so, subject to
17  * the following conditions:
18  *
19  * The above copyright notice and this permission notice shall be
20  * included in all copies or substantial portions of the Software.
21  *
22  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
25  * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
26  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
27  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
28  * OTHER DEALINGS IN THE SOFTWARE.
29  ***************************************************************************/
30 #ifndef _CEGUIInputEvent_h_
31 #define _CEGUIInputEvent_h_
32 
33 #include "CEGUI/Base.h"
34 #include "CEGUI/EventArgs.h"
35 #include "CEGUI/String.h"
36 #include "CEGUI/Vector.h"
37 #include "CEGUI/Size.h"
38 
39 #if defined(_MSC_VER)
40 # pragma warning(push)
41 # pragma warning(disable : 4251)
42 #endif
43 
44 // Start of CEGUI namespace section
45 namespace CEGUI
46 {
51 struct CEGUIEXPORT Key
52 {
53  // enumeration of scan codes. Customised from table taken from Ogre, which took them from DirectInput...
54  enum Scan
55  {
56  Unknown =0x00,
57  Escape =0x01,
58  One =0x02,
59  Two =0x03,
60  Three =0x04,
61  Four =0x05,
62  Five =0x06,
63  Six =0x07,
64  Seven =0x08,
65  Eight =0x09,
66  Nine =0x0A,
67  Zero =0x0B,
68  Minus =0x0C, /* - on main keyboard */
69  Equals =0x0D,
70  Backspace =0x0E, /* backspace */
71  Tab =0x0F,
72  Q =0x10,
73  W =0x11,
74  E =0x12,
75  R =0x13,
76  T =0x14,
77  Y =0x15,
78  U =0x16,
79  I =0x17,
80  O =0x18,
81  P =0x19,
82  LeftBracket =0x1A,
83  RightBracket =0x1B,
84  Return =0x1C, /* Enter on main keyboard */
85  LeftControl =0x1D,
86  A =0x1E,
87  S =0x1F,
88  D =0x20,
89  F =0x21,
90  G =0x22,
91  H =0x23,
92  J =0x24,
93  K =0x25,
94  L =0x26,
95  Semicolon =0x27,
96  Apostrophe =0x28,
97  Grave =0x29, /* accent grave */
98  LeftShift =0x2A,
99  Backslash =0x2B,
100  Z =0x2C,
101  X =0x2D,
102  C =0x2E,
103  V =0x2F,
104  B =0x30,
105  N =0x31,
106  M =0x32,
107  Comma =0x33,
108  Period =0x34, /* . on main keyboard */
109  Slash =0x35, /* '/' on main keyboard */
110  RightShift =0x36,
111  Multiply =0x37, /* * on numeric keypad */
112  LeftAlt =0x38, /* left Alt */
113  Space =0x39,
114  Capital =0x3A,
115  F1 =0x3B,
116  F2 =0x3C,
117  F3 =0x3D,
118  F4 =0x3E,
119  F5 =0x3F,
120  F6 =0x40,
121  F7 =0x41,
122  F8 =0x42,
123  F9 =0x43,
124  F10 =0x44,
125  NumLock =0x45,
126  ScrollLock =0x46, /* Scroll Lock */
127  Numpad7 =0x47,
128  Numpad8 =0x48,
129  Numpad9 =0x49,
130  Subtract =0x4A, /* - on numeric keypad */
131  Numpad4 =0x4B,
132  Numpad5 =0x4C,
133  Numpad6 =0x4D,
134  Add =0x4E, /* + on numeric keypad */
135  Numpad1 =0x4F,
136  Numpad2 =0x50,
137  Numpad3 =0x51,
138  Numpad0 =0x52,
139  Decimal =0x53, /* . on numeric keypad */
140  OEM_102 =0x56, /* < > | on UK/Germany keyboards */
141  F11 =0x57,
142  F12 =0x58,
143  F13 =0x64, /* (NEC PC98) */
144  F14 =0x65, /* (NEC PC98) */
145  F15 =0x66, /* (NEC PC98) */
146  Kana =0x70, /* (Japanese keyboard) */
147  ABNT_C1 =0x73, /* / ? on Portugese (Brazilian) keyboards */
148  Convert =0x79, /* (Japanese keyboard) */
149  NoConvert =0x7B, /* (Japanese keyboard) */
150  Yen =0x7D, /* (Japanese keyboard) */
151  ABNT_C2 =0x7E, /* Numpad . on Portugese (Brazilian) keyboards */
152  NumpadEquals =0x8D, /* = on numeric keypad (NEC PC98) */
153  PrevTrack =0x90, /* Previous Track (KC_CIRCUMFLEX on Japanese keyboard) */
154  At =0x91, /* (NEC PC98) */
155  Colon =0x92, /* (NEC PC98) */
156  Underline =0x93, /* (NEC PC98) */
157  Kanji =0x94, /* (Japanese keyboard) */
158  Stop =0x95, /* (NEC PC98) */
159  AX =0x96, /* (Japan AX) */
160  Unlabeled =0x97, /* (J3100) */
161  NextTrack =0x99, /* Next Track */
162  NumpadEnter =0x9C, /* Enter on numeric keypad */
163  RightControl =0x9D,
164  Mute =0xA0, /* Mute */
165  Calculator =0xA1, /* Calculator */
166  PlayPause =0xA2, /* Play / Pause */
167  MediaStop =0xA4, /* Media Stop */
168  VolumeDown =0xAE, /* Volume - */
169  VolumeUp =0xB0, /* Volume + */
170  WebHome =0xB2, /* Web home */
171  NumpadComma =0xB3, /* , on numeric keypad (NEC PC98) */
172  Divide =0xB5, /* / on numeric keypad */
173  SysRq =0xB7,
174  RightAlt =0xB8, /* right Alt */
175  Pause =0xC5, /* Pause */
176  Home =0xC7, /* Home on arrow keypad */
177  ArrowUp =0xC8, /* UpArrow on arrow keypad */
178  PageUp =0xC9, /* PgUp on arrow keypad */
179  ArrowLeft =0xCB, /* LeftArrow on arrow keypad */
180  ArrowRight =0xCD, /* RightArrow on arrow keypad */
181  End =0xCF, /* End on arrow keypad */
182  ArrowDown =0xD0, /* DownArrow on arrow keypad */
183  PageDown =0xD1, /* PgDn on arrow keypad */
184  Insert =0xD2, /* Insert on arrow keypad */
185  Delete =0xD3, /* Delete on arrow keypad */
186  LeftWindows =0xDB, /* Left Windows key */
187  RightWindows =0xDC, /* Right Windows key - Correct spelling :) */
188  AppMenu =0xDD, /* AppMenu key */
189  Power =0xDE, /* System Power */
190  Sleep =0xDF, /* System Sleep */
191  Wake =0xE3, /* System Wake */
192  WebSearch =0xE5, /* Web Search */
193  WebFavorites =0xE6, /* Web Favorites */
194  WebRefresh =0xE7, /* Web Refresh */
195  WebStop =0xE8, /* Web Stop */
196  WebForward =0xE9, /* Web Forward */
197  WebBack =0xEA, /* Web Back */
198  MyComputer =0xEB, /* My Computer */
199  Mail =0xEC, /* Mail */
200  MediaSelect =0xED /* Media Select */
201  };
202 
203 };
204 
205 
211 {
226 };
227 
228 
234 {
235  LeftMouse = 0x0001,
236  RightMouse = 0x0002,
237  Shift = 0x0004,
238  Control = 0x0008,
239  MiddleMouse = 0x0010,
240  X1Mouse = 0x0020,
241  X2Mouse = 0x0040,
242  Alt = 0x0080,
243  InvalidSysKey = 0x8000
244 };
245 
246 
252 class CEGUIEXPORT WindowEventArgs : public EventArgs
253 {
254 public:
255  WindowEventArgs(Window* wnd) : window(wnd) {}
256 
258 };
259 
264 class CEGUIEXPORT UpdateEventArgs : public WindowEventArgs
265 {
266 public:
267  UpdateEventArgs(Window* window, float tslf) :
268  WindowEventArgs(window),
269  d_timeSinceLastFrame(tslf)
270  {}
271 
273 };
274 
275 
281 class CEGUIEXPORT MouseEventArgs : public WindowEventArgs
282 {
283 public:
284  MouseEventArgs(Window* wnd) : WindowEventArgs(wnd) {}
285 
289  uint sysKeys;
290  float wheelChange;
291  uint clickCount;
292 };
293 
294 
300 class CEGUIEXPORT MouseCursorEventArgs : public EventArgs
301 {
302 public:
303  MouseCursorEventArgs(MouseCursor* cursor) : mouseCursor(cursor) {}
304 
306  const Image* image;
307 };
308 
309 
315 class CEGUIEXPORT KeyEventArgs : public WindowEventArgs
316 {
317 public:
318  KeyEventArgs(Window* wnd) : WindowEventArgs(wnd) {}
319 
321  Key::Scan scancode;
322  uint sysKeys;
323 };
324 
325 
330 class CEGUIEXPORT ActivationEventArgs : public WindowEventArgs
331 {
332 public:
334 
336 };
337 
342 class CEGUIEXPORT DragDropEventArgs : public WindowEventArgs
343 {
344 public:
346  DragContainer* dragDropItem; //<! pointer to the DragContainer window being dragged / dropped.
347 };
348 
354 class CEGUIEXPORT DisplayEventArgs : public EventArgs
355 {
356 public:
357  DisplayEventArgs(const Sizef& sz):
358  size(sz)
359  {}
360 
363 };
364 
366 class CEGUIEXPORT ResourceEventArgs : public EventArgs
367 {
368 public:
369  ResourceEventArgs(const String& type, const String& name) :
370  resourceType(type),
371  resourceName(name)
372  {}
373 
378 };
379 
381 class CEGUIEXPORT FontEventArgs : public EventArgs
382 {
383 public:
384  FontEventArgs(Font* font) :
385  font(font)
386  {}
387 
390 };
391 
392 } // End of CEGUI namespace section
393 
394 #if defined(_MSC_VER)
395 # pragma warning(pop)
396 #endif
397 
398 #endif // end of guard _CEGUIInputEvent_h_