Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/trunk/src/util/event/event_handler.h @ 4368

Last change on this file since 4368 was 4368, checked in by patrick, 19 years ago

orxonox/trunk: started implementation of key mapper

File size: 1.1 KB
Line 
1/*!
2    \file event_handler.h
3    \brief Definition of the EventHandler
4   
5*/
6
7#ifndef _EVENT_HANDLER_H
8#define _EVENT_HANDLER_H
9
10#include "base_object.h"
11#include "event_def.h"
12
13class EventListener;
14
15
16
17
18//! Key aliasing structure
19/**
20   This structure contains the key aliasing information, e.g. the command strings that
21   have been bound to the keys.
22*/
23typedef struct
24{
25  char keys[N_STD_KEYS][CMD_LENGHT];
26  char buttons[N_BUTTONS][CMD_LENGHT];
27} KeyBindings;
28
29
30//! The one Event Handler from Orxonox
31class EventHandler : public BaseObject {
32
33 public:
34  static EventHandler* getInstance(void);
35  virtual ~EventHandler(void);
36
37  void setState(elState state);
38
39  void subscribeListener(EventListener* el, elState state, int eventType);
40  void unsubscribeListener(int eventType, elState state);
41  void flush(elState state);
42 
43  void loadKeyBindings(const char* fileName);
44
45  void tick(float t);
46  void process();
47
48 private:
49  EventHandler(void);
50 
51
52 private:
53  static EventHandler* singletonRef;
54  KeyBindings* keyAliases;
55  EventListener*** listeners;                         //!< a list of registered listeners
56  elState state;
57
58};
59
60#endif /* _EVENT_HANDLER_H */
Note: See TracBrowser for help on using the repository browser.