Public Member Functions | |
EventManager () | |
Constructor. | |
~EventManager () | |
Deconstructor. | |
void | init () |
Initialises the EventManager. | |
void | clear () |
Clears the EventManager. | |
void | grab () |
Increases the reference counter. | |
void | drop () |
Decreases the reference counter. | |
bool | createEventGroup (const std::string &groupName) |
Creates a new event group, a collection of events. | |
bool | createEventSlot (const std::string &groupName, const std::string &slotName) |
Creates a new event slot in the given event group. | |
template<typename T > | |
bool | connectEventSignal (const std::string &groupName, const std::string &slotName, T *t, void(T::*m)(void *)) |
Connects a function to the given event slot. | |
template<typename T > | |
bool | disconnectEventSignal (const std::string &groupName, const std::string &slotName, T *t) |
Disconnects a function from the given event slot. | |
bool | emitEvent (const std::string &groupName, const std::string &slotName, void *p=0) |
Emits an event to the given event slot. | |
bool | getIsKeyDown (EKEY_CODE keyCode) const |
Checks if the given key is down. | |
bool | getIsKeyUp (EKEY_CODE keyCode) const |
Checks if the given key is up. | |
s32 | getMouseX () const |
Returns the X-coordinate of the mouse position. | |
s32 | getMouseY () const |
Returns the Y-coordinate of the mouse position. | |
const vector2di & | getMousePos () const |
Returns the position of the mouse as a 2d vector. | |
f32 | getMouseWheel () const |
Gets the mouse wheel position. | |
void | removeEventGroups () |
Removes all event groups from the EventManager. | |
bool | removeEventSlots (const std::string &groupName) |
Removes all event slots from the given event group. | |
bool | removeEventGroup (const std::string &groupName) |
Removes the given event group from the Event Manager. | |
bool | removeEventSlot (const std::string &groupName, const std::string &slotName) |
Removes the given event slot from the given event group. | |
virtual bool | OnEvent (const SEvent &event) |
Handles the events sent by the Irrlicht engine. |
Definition at line 29 of file EventManager.h.
EventManager::EventManager | ( | ) |
EventManager::~EventManager | ( | ) |
void EventManager::clear | ( | ) |
bool EventManager::connectEventSignal | ( | const std::string & | groupName, | |
const std::string & | slotName, | |||
T * | t, | |||
void(T::*)(void *) | m | |||
) | [inline] |
Connects a function to the given event slot.
groupName | Name of the event group. | |
slotName | Name of the event slot. | |
t | Pointer to the object that will function as this-object when the connect function is called. | |
m | Pointer to the function. |
Definition at line 70 of file EventManager.h.
bool EventManager::createEventGroup | ( | const std::string & | groupName | ) |
Creates a new event group, a collection of events.
groupName | Name of the event group. |
Definition at line 238 of file EventManager.cpp.
bool EventManager::createEventSlot | ( | const std::string & | groupName, | |
const std::string & | slotName | |||
) |
Creates a new event slot in the given event group.
groupName | Name of the event group. | |
slotName | Name of the event slot. |
Definition at line 255 of file EventManager.cpp.
bool EventManager::disconnectEventSignal | ( | const std::string & | groupName, | |
const std::string & | slotName, | |||
T * | t | |||
) | [inline] |
Disconnects a function from the given event slot.
groupName | Name of the event group. | |
slotName | Name of the event slot. | |
t | Pointer to the object that will function as this-object when the connect function is called. |
Definition at line 101 of file EventManager.h.
void EventManager::drop | ( | ) | [virtual] |
Decreases the reference counter.
Reimplemented from ReferenceCounted.
Definition at line 232 of file EventManager.cpp.
bool EventManager::emitEvent | ( | const std::string & | groupName, | |
const std::string & | slotName, | |||
void * | p = 0 | |||
) |
Emits an event to the given event slot.
groupName | Name of the event group. | |
slotName | Name of the event slot. | |
p | Pointer to data which will be passed to all functions called. |
Definition at line 280 of file EventManager.cpp.
bool EventManager::getIsKeyDown | ( | EKEY_CODE | keyCode | ) | const |
bool EventManager::getIsKeyUp | ( | EKEY_CODE | keyCode | ) | const |
const vector2di & EventManager::getMousePos | ( | ) | const |
f32 EventManager::getMouseWheel | ( | ) | const |
s32 EventManager::getMouseX | ( | ) | const |
s32 EventManager::getMouseY | ( | ) | const |
void EventManager::grab | ( | ) | [virtual] |
Increases the reference counter.
Reimplemented from ReferenceCounted.
Definition at line 226 of file EventManager.cpp.
void EventManager::init | ( | ) |
bool EventManager::OnEvent | ( | const SEvent & | event | ) | [virtual] |
Handles the events sent by the Irrlicht engine.
Definition at line 404 of file EventManager.cpp.
bool EventManager::removeEventGroup | ( | const std::string & | groupName | ) |
Removes the given event group from the Event Manager.
groupName | Name of the event group to remove. |
Definition at line 366 of file EventManager.cpp.
void EventManager::removeEventGroups | ( | ) |
bool EventManager::removeEventSlot | ( | const std::string & | groupName, | |
const std::string & | slotName | |||
) |
Removes the given event slot from the given event group.
groupName | Name of the event group. | |
slotName | Name of the event slot to remove. |
Definition at line 381 of file EventManager.cpp.
bool EventManager::removeEventSlots | ( | const std::string & | groupName | ) |
Removes all event slots from the given event group.
groupName | Name of the event group. |
Definition at line 349 of file EventManager.cpp.