Events:
Pressed keys are stored in m_pressed array, this array is shared and updated by InputAgent.
Definition at line 20 of file InputHandler.h.
Public Member Functions | |
InputHandler () | |
void | takePressed (Uint8 *pressed) |
void | mouseState (const V2 &loc, Uint8 buttons) |
virtual void | keyEvent (const KeyStroke &) |
virtual void | mouseEvent (const MouseStroke &) |
virtual bool | isPressed (SDLKey key) const |
virtual bool | isLeftPressed () const |
virtual bool | isMiddlePressed () const |
virtual bool | isRightPressed () const |
virtual V2 | getMouseLoc () const |
virtual std::string | toString () const |
|
Definition at line 14 of file InputHandler.cpp. 00015 : m_mouseLoc(-1, -1) 00016 { 00017 m_pressed = NULL; 00018 m_buttons = 0; 00019 }
|
|
Implements InputProvider. Definition at line 37 of file InputHandler.h. 00037 { return m_mouseLoc; }
|
|
Implements InputProvider. Definition at line 35 of file InputHandler.cpp. 00036 {
00037 return m_buttons & SDL_BUTTON(1);
00038 }
|
|
Implements InputProvider. Definition at line 41 of file InputHandler.cpp. 00042 {
00043 return m_buttons & SDL_BUTTON(2);
00044 }
|
|
Implements InputProvider. Definition at line 29 of file InputHandler.cpp. 00030 {
00031 return m_pressed && m_pressed[key];
00032 }
|
|
Implements InputProvider. Definition at line 47 of file InputHandler.cpp. 00048 {
00049 return m_buttons & SDL_BUTTON(3);
00050 }
|
|
Reimplemented in StateInput. Definition at line 30 of file InputHandler.h. 00030 {}
|
|
Reimplemented in LevelInput, PedoInput, WorldInput, HelpInput, OptionsInput, and DemoInput. Definition at line 31 of file InputHandler.h. 00031 {}
|
|
Definition at line 22 of file InputHandler.cpp. 00023 { 00024 m_mouseLoc = loc; 00025 m_buttons = buttons; 00026 }
|
|
Definition at line 27 of file InputHandler.h. 00027 { m_pressed = pressed; }
|
|
Implements InputProvider. Definition at line 53 of file InputHandler.cpp. 00054 { 00055 return ExInfo("input") 00056 .addInfo("mouse", m_mouseLoc.toString()) 00057 .addInfo("buttons", m_buttons).info(); 00058 }
|