Home | Namespaces | Hierarchy | Alphabetical List | Class list | Files | Namespace Members | Class members | File members | Tutorials
IEventReceiver.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2010 Nikolaus Gebhardt
2 // This file is part of the "Irrlicht Engine".
3 // For conditions of distribution and use, see copyright notice in irrlicht.h
4 
5 #ifndef __I_EVENT_RECEIVER_H_INCLUDED__
6 #define __I_EVENT_RECEIVER_H_INCLUDED__
7 
8 #include "ILogger.h"
9 #include "Keycodes.h"
10 #include "irrString.h"
11 
12 namespace irr
13 {
16  {
18 
23 
25 
31 
33 
36 
38 
46 
48 
51 
53 
66 
69  EGUIET_FORCE_32_BIT = 0x7fffffff
70 
71  };
72 
75  {
78 
81 
84 
87 
90 
93 
96 
100 
104 
108 
112 
116 
120 
124 
127  };
128 
131  {
132  EMBSM_LEFT = 0x01,
133  EMBSM_RIGHT = 0x02,
134  EMBSM_MIDDLE = 0x04,
135 
137  EMBSM_EXTRA1 = 0x08,
138 
140  EMBSM_EXTRA2 = 0x10,
141 
142  EMBSM_FORCE_32_BIT = 0x7fffffff
143  };
144 
145  namespace gui
146  {
147 
148  class IGUIElement;
149 
152  {
154 
157 
159 
161 
163 
165 
167 
169 
171 
174 
177 
180 
183 
185 
187 
189 
191 
194 
197 
200 
203 
206 
209 
212 
215 
218 
221 
224 
227 
230 
233 
238 
241 
244 
247 
250 
253 
256  };
257  } // end namespace gui
258 
259 
261 struct SEvent
262 {
264  struct SGUIEvent
265  {
268 
271 
274 
275  };
276 
278  struct SMouseInput
279  {
282 
285 
287 
289 
291  bool Shift:1;
292 
294  bool Control:1;
295 
300 
302  bool isLeftPressed() const { return 0 != ( ButtonStates & EMBSM_LEFT ); }
303 
305  bool isRightPressed() const { return 0 != ( ButtonStates & EMBSM_RIGHT ); }
306 
308  bool isMiddlePressed() const { return 0 != ( ButtonStates & EMBSM_MIDDLE ); }
309 
312  };
313 
315  struct SKeyInput
316  {
318  wchar_t Char;
319 
322 
324  bool PressedDown:1;
325 
327  bool Shift:1;
328 
330  bool Control:1;
331  };
332 
334 
342  {
343  enum
344  {
346 
347  AXIS_X = 0, // e.g. analog stick 1 left to right
348  AXIS_Y, // e.g. analog stick 1 top to bottom
349  AXIS_Z, // e.g. throttle, or analog 2 stick 2 left to right
350  AXIS_R, // e.g. rudder, or analog 2 stick 2 top to bottom
354  };
355 
359 
369 
376 
378 
381 
383  bool IsButtonPressed(u32 button) const
384  {
385  if(button >= (u32)NUMBER_OF_BUTTONS)
386  return false;
387 
388  return (ButtonStates & (1 << button)) ? true : false;
389  }
390  };
391 
392 
394  struct SLogEvent
395  {
397  const c8* Text;
398 
401  };
402 
404  struct SUserEvent
405  {
408 
411  };
412 
414  union
415  {
422  };
423 
424 };
425 
427 
433 {
434 public:
435 
437  virtual ~IEventReceiver() {}
438 
440 
445  virtual bool OnEvent(const SEvent& event) = 0;
446 };
447 
448 
451 {
453 
457 
460 
463 
465 
468 
470 
472  enum
473  {
476 
479 
482  } PovHat;
483 }; // struct SJoystickInfo
484 
485 
486 } // end namespace irr
487 
488 #endif
489 

The Irrlicht Engine
The Irrlicht Engine Documentation © 2003-2010 by Nikolaus Gebhardt. Generated on Tue Jun 5 2012 17:57:11 by Doxygen (1.8.1)