Public Member Functions | |
EventManager () | |
Constructor. | |
~EventManager () | |
Deconstructor. | |
void | init () |
Initialises the EventManager. | |
void | clear () |
Clears the EventManager. | |
void | refAdd () |
Increases the reference counter. | |
void | refRelease () |
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, void(T::*m)(void *)) |
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 | removeAllEventGroups () |
Removes all event groups from the EventManager. | |
bool | removeAllEventSlots (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 28 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 69 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 235 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 252 of file EventManager.cpp.
bool EventManager::disconnectEventSignal | ( | const std::string & | groupName, | |
const std::string & | slotName, | |||
T * | t, | |||
void(T::*)(void *) | m | |||
) | [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. | |
m | Pointer to the function. |
Definition at line 101 of file EventManager.h.
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 277 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::init | ( | ) |
bool EventManager::OnEvent | ( | const SEvent & | event | ) | [virtual] |
Handles the events sent by the Irrlicht engine.
Definition at line 401 of file EventManager.cpp.
void EventManager::refAdd | ( | ) |
Increases the reference counter.
Definition at line 223 of file EventManager.cpp.
void EventManager::refRelease | ( | ) |
Decreases the reference counter.
Definition at line 229 of file EventManager.cpp.
void EventManager::removeAllEventGroups | ( | ) |
bool EventManager::removeAllEventSlots | ( | const std::string & | groupName | ) |
Removes all event slots from the given event group.
groupName | Name of the event group. |
Definition at line 346 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 363 of file EventManager.cpp.
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 378 of file EventManager.cpp.