/*! \file event_handler.h \brief Definition of the EventHandler */ #ifndef _EVENT_HANDLER_H #define _EVENT_HANDLER_H #include "base_object.h" #include "event_def.h" class EventListener; //! Key aliasing structure /** This structure contains the key aliasing information, e.g. the command strings that have been bound to the keys. */ typedef struct { char keys[N_STD_KEYS][CMD_LENGHT]; char buttons[N_BUTTONS][CMD_LENGHT]; } KeyBindings; //! The one Event Handler from Orxonox class EventHandler : public BaseObject { public: static EventHandler* getInstance(void); virtual ~EventHandler(void); void setState(elState state); void subscribeListener(EventListener* el, elState state, int eventType); void unsubscribeListener(int eventType, elState state); void flush(elState state); void loadKeyBindings(const char* fileName); void tick(float t); void process(); private: EventHandler(void); private: static EventHandler* singletonRef; KeyBindings* keyAliases; EventListener*** listeners; //!< a list of registered listeners elState state; }; #endif /* _EVENT_HANDLER_H */