Crazy Eddies GUI System  0.7.2
CEGUIInputEvent.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 "CEGUIBase.h"
34 #include "CEGUIEventArgs.h"
35 #include "CEGUIString.h"
36 #include "CEGUIVector.h"
37 
38 
39 // Start of CEGUI namespace section
40 namespace CEGUI
41 {
46 struct CEGUIEXPORT Key
47 {
48  // enumeration of scan codes. Customised from table taken from Ogre, which took them from DirectInput...
49  enum Scan
50  {
51  Escape =0x01,
52  One =0x02,
53  Two =0x03,
54  Three =0x04,
55  Four =0x05,
56  Five =0x06,
57  Six =0x07,
58  Seven =0x08,
59  Eight =0x09,
60  Nine =0x0A,
61  Zero =0x0B,
62  Minus =0x0C, /* - on main keyboard */
63  Equals =0x0D,
64  Backspace =0x0E, /* backspace */
65  Tab =0x0F,
66  Q =0x10,
67  W =0x11,
68  E =0x12,
69  R =0x13,
70  T =0x14,
71  Y =0x15,
72  U =0x16,
73  I =0x17,
74  O =0x18,
75  P =0x19,
76  LeftBracket =0x1A,
77  RightBracket =0x1B,
78  Return =0x1C, /* Enter on main keyboard */
79  LeftControl =0x1D,
80  A =0x1E,
81  S =0x1F,
82  D =0x20,
83  F =0x21,
84  G =0x22,
85  H =0x23,
86  J =0x24,
87  K =0x25,
88  L =0x26,
89  Semicolon =0x27,
90  Apostrophe =0x28,
91  Grave =0x29, /* accent grave */
92  LeftShift =0x2A,
93  Backslash =0x2B,
94  Z =0x2C,
95  X =0x2D,
96  C =0x2E,
97  V =0x2F,
98  B =0x30,
99  N =0x31,
100  M =0x32,
101  Comma =0x33,
102  Period =0x34, /* . on main keyboard */
103  Slash =0x35, /* '/' on main keyboard */
104  RightShift =0x36,
105  Multiply =0x37, /* * on numeric keypad */
106  LeftAlt =0x38, /* left Alt */
107  Space =0x39,
108  Capital =0x3A,
109  F1 =0x3B,
110  F2 =0x3C,
111  F3 =0x3D,
112  F4 =0x3E,
113  F5 =0x3F,
114  F6 =0x40,
115  F7 =0x41,
116  F8 =0x42,
117  F9 =0x43,
118  F10 =0x44,
119  NumLock =0x45,
120  ScrollLock =0x46, /* Scroll Lock */
121  Numpad7 =0x47,
122  Numpad8 =0x48,
123  Numpad9 =0x49,
124  Subtract =0x4A, /* - on numeric keypad */
125  Numpad4 =0x4B,
126  Numpad5 =0x4C,
127  Numpad6 =0x4D,
128  Add =0x4E, /* + on numeric keypad */
129  Numpad1 =0x4F,
130  Numpad2 =0x50,
131  Numpad3 =0x51,
132  Numpad0 =0x52,
133  Decimal =0x53, /* . on numeric keypad */
134  OEM_102 =0x56, /* < > | on UK/Germany keyboards */
135  F11 =0x57,
136  F12 =0x58,
137  F13 =0x64, /* (NEC PC98) */
138  F14 =0x65, /* (NEC PC98) */
139  F15 =0x66, /* (NEC PC98) */
140  Kana =0x70, /* (Japanese keyboard) */
141  ABNT_C1 =0x73, /* / ? on Portugese (Brazilian) keyboards */
142  Convert =0x79, /* (Japanese keyboard) */
143  NoConvert =0x7B, /* (Japanese keyboard) */
144  Yen =0x7D, /* (Japanese keyboard) */
145  ABNT_C2 =0x7E, /* Numpad . on Portugese (Brazilian) keyboards */
146  NumpadEquals =0x8D, /* = on numeric keypad (NEC PC98) */
147  PrevTrack =0x90, /* Previous Track (KC_CIRCUMFLEX on Japanese keyboard) */
148  At =0x91, /* (NEC PC98) */
149  Colon =0x92, /* (NEC PC98) */
150  Underline =0x93, /* (NEC PC98) */
151  Kanji =0x94, /* (Japanese keyboard) */
152  Stop =0x95, /* (NEC PC98) */
153  AX =0x96, /* (Japan AX) */
154  Unlabeled =0x97, /* (J3100) */
155  NextTrack =0x99, /* Next Track */
156  NumpadEnter =0x9C, /* Enter on numeric keypad */
157  RightControl =0x9D,
158  Mute =0xA0, /* Mute */
159  Calculator =0xA1, /* Calculator */
160  PlayPause =0xA2, /* Play / Pause */
161  MediaStop =0xA4, /* Media Stop */
162  VolumeDown =0xAE, /* Volume - */
163  VolumeUp =0xB0, /* Volume + */
164  WebHome =0xB2, /* Web home */
165  NumpadComma =0xB3, /* , on numeric keypad (NEC PC98) */
166  Divide =0xB5, /* / on numeric keypad */
167  SysRq =0xB7,
168  RightAlt =0xB8, /* right Alt */
169  Pause =0xC5, /* Pause */
170  Home =0xC7, /* Home on arrow keypad */
171  ArrowUp =0xC8, /* UpArrow on arrow keypad */
172  PageUp =0xC9, /* PgUp on arrow keypad */
173  ArrowLeft =0xCB, /* LeftArrow on arrow keypad */
174  ArrowRight =0xCD, /* RightArrow on arrow keypad */
175  End =0xCF, /* End on arrow keypad */
176  ArrowDown =0xD0, /* DownArrow on arrow keypad */
177  PageDown =0xD1, /* PgDn on arrow keypad */
178  Insert =0xD2, /* Insert on arrow keypad */
179  Delete =0xD3, /* Delete on arrow keypad */
180  LeftWindows =0xDB, /* Left Windows key */
181  RightWindows =0xDC, /* Right Windows key - Correct spelling :) */
182  AppMenu =0xDD, /* AppMenu key */
183  Power =0xDE, /* System Power */
184  Sleep =0xDF, /* System Sleep */
185  Wake =0xE3, /* System Wake */
186  WebSearch =0xE5, /* Web Search */
187  WebFavorites =0xE6, /* Web Favorites */
188  WebRefresh =0xE7, /* Web Refresh */
189  WebStop =0xE8, /* Web Stop */
190  WebForward =0xE9, /* Web Forward */
191  WebBack =0xEA, /* Web Back */
192  MyComputer =0xEB, /* My Computer */
193  Mail =0xEC, /* Mail */
194  MediaSelect =0xED /* Media Select */
195  };
196 
197 };
198 
199 
205 {
220 };
221 
222 
228 {
229  LeftMouse = 0x0001,
230  RightMouse = 0x0002,
231  Shift = 0x0004,
232  Control = 0x0008,
233  MiddleMouse = 0x0010,
234  X1Mouse = 0x0020,
235  X2Mouse = 0x0040,
236  Alt = 0x0080
237 };
238 
239 
245 class CEGUIEXPORT WindowEventArgs : public EventArgs
246 {
247 public:
248  WindowEventArgs(Window* wnd) : window(wnd) {}
249 
251 };
252 
257 class CEGUIEXPORT UpdateEventArgs : public WindowEventArgs
258 {
259 public:
260  UpdateEventArgs(Window* window, float tslf) :
261  WindowEventArgs(window),
262  d_timeSinceLastFrame(tslf)
263  {}
264 
266 };
267 
268 
274 class CEGUIEXPORT MouseEventArgs : public WindowEventArgs
275 {
276 public:
277  MouseEventArgs(Window* wnd) : WindowEventArgs(wnd) {}
278 
282  uint sysKeys;
283  float wheelChange;
284  uint clickCount;
285 };
286 
287 
293 class CEGUIEXPORT MouseCursorEventArgs : public EventArgs
294 {
295 public:
296  MouseCursorEventArgs(MouseCursor* cursor) : mouseCursor(cursor) {}
297 
299  const Image* image;
300 };
301 
302 
308 class CEGUIEXPORT KeyEventArgs : public WindowEventArgs
309 {
310 public:
311  KeyEventArgs(Window* wnd) : WindowEventArgs(wnd) {}
312 
313  utf32 codepoint;
314  Key::Scan scancode;
315  uint sysKeys;
316 };
317 
318 
323 class CEGUIEXPORT ActivationEventArgs : public WindowEventArgs
324 {
325 public:
327 
329 };
330 
335 class CEGUIEXPORT DragDropEventArgs : public WindowEventArgs
336 {
337 public:
339  DragContainer* dragDropItem; //<! pointer to the DragContainer window being dragged / dropped.
340 };
341 
347 class CEGUIEXPORT DisplayEventArgs : public EventArgs
348 {
349 public:
350  DisplayEventArgs(const Size& sz) : size(sz) {}
351 
354 };
355 
357 class CEGUIEXPORT ResourceEventArgs : public EventArgs
358 {
359 public:
360  ResourceEventArgs(const String& type, const String& name) :
361  resourceType(type),
362  resourceName(name)
363  {}
364 
369 };
370 
371 
372 } // End of CEGUI namespace section
373 
374 
375 #endif // end of guard _CEGUIInputEvent_h_