|
FIFE
|
#include <librocketinputprocessor.h>
Collaboration diagram for FIFE::LibRocketInputProcessor:Public Member Functions | |
| LibRocketInputProcessor (Rocket::Core::Context *context) | |
| Constructor. More... | |
| ~LibRocketInputProcessor () | |
| Destructor. More... | |
| bool | onSdlEvent (SDL_Event &evt) |
| Processes SDL input and converts it to librocket input, then forwards it to the librocket context. More... | |
| void | turn () |
| Called each frame to perform update operations. More... | |
Private Member Functions | |
| void | updateKeyModState () |
| Updates the key mod state bitmask. More... | |
| bool | processMouseMotion (SDL_Event &event) |
| Process a mouse motion event. More... | |
| bool | processMouseInput (SDL_Event &event) |
| Process a mouse input event. More... | |
| bool | processMouseWheelMotion (SDL_Event &event) |
| Process a mouse wheel motion event. More... | |
| bool | processKeyInput (SDL_Event &event) |
| Process a key input event. More... | |
| void | populateKeyMap () |
| Creates the key map. More... | |
Private Attributes | |
| Rocket::Core::Context * | m_context |
| Reference to librocket's context. More... | |
| uint32_t | m_keyModState |
| Bitmask that stores key modifiers. More... | |
| int32_t | m_wheelCounter |
| Counts how many times the wheel has been moved. More... | |
| std::map< SDLKey, Rocket::Core::Input::KeyIdentifier > | m_keyMap |
| Keymap to convert SDL key to Librocket key. More... | |
Definition at line 47 of file librocketinputprocessor.h.
| FIFE::LibRocketInputProcessor::LibRocketInputProcessor | ( | Rocket::Core::Context * | context | ) |
Constructor.
Definition at line 38 of file librocketinputprocessor.cpp.
References populateKeyMap().
| FIFE::LibRocketInputProcessor::~LibRocketInputProcessor | ( | ) |
Destructor.
Definition at line 46 of file librocketinputprocessor.cpp.
| bool FIFE::LibRocketInputProcessor::onSdlEvent | ( | SDL_Event & | evt | ) |
Processes SDL input and converts it to librocket input, then forwards it to the librocket context.
| evt | The SDL input. |
Definition at line 85 of file librocketinputprocessor.cpp.
References processKeyInput(), processMouseInput(), processMouseMotion(), and updateKeyModState().
Referenced by FIFE::LibRocketManager::onSdlEvent().
Here is the caller graph for this function:
|
private |
Creates the key map.
Definition at line 203 of file librocketinputprocessor.cpp.
References m_keyMap.
Referenced by LibRocketInputProcessor().
Here is the caller graph for this function:
|
private |
Process a key input event.
Definition at line 178 of file librocketinputprocessor.cpp.
References m_context, m_keyMap, and m_keyModState.
Referenced by onSdlEvent().
Here is the caller graph for this function:
|
private |
Process a mouse input event.
Definition at line 131 of file librocketinputprocessor.cpp.
References m_context, m_keyModState, and processMouseWheelMotion().
Referenced by onSdlEvent().
Here is the caller graph for this function:
|
private |
Process a mouse motion event.
Definition at line 121 of file librocketinputprocessor.cpp.
References m_context, and m_keyModState.
Referenced by onSdlEvent().
Here is the caller graph for this function:
|
private |
Process a mouse wheel motion event.
Definition at line 154 of file librocketinputprocessor.cpp.
References m_context, m_keyModState, and m_wheelCounter.
Referenced by processMouseInput().
Here is the caller graph for this function:| void FIFE::LibRocketInputProcessor::turn | ( | ) |
Called each frame to perform update operations.
Definition at line 114 of file librocketinputprocessor.cpp.
References m_context, m_keyModState, and m_wheelCounter.
Referenced by FIFE::LibRocketManager::turn().
Here is the caller graph for this function:
|
private |
Updates the key mod state bitmask.
Definition at line 49 of file librocketinputprocessor.cpp.
References m_keyModState.
Referenced by onSdlEvent().
Here is the caller graph for this function:
|
private |
Reference to librocket's context.
Definition at line 101 of file librocketinputprocessor.h.
Referenced by processKeyInput(), processMouseInput(), processMouseMotion(), processMouseWheelMotion(), and turn().
|
private |
Keymap to convert SDL key to Librocket key.
Definition at line 115 of file librocketinputprocessor.h.
Referenced by populateKeyMap(), and processKeyInput().
|
private |
Bitmask that stores key modifiers.
Definition at line 105 of file librocketinputprocessor.h.
Referenced by processKeyInput(), processMouseInput(), processMouseMotion(), processMouseWheelMotion(), turn(), and updateKeyModState().
|
private |
Counts how many times the wheel has been moved.
Negative value means that the wheel has been moved abs(m_wheelCounter) upwards, positive value means that the wheel has been moved m_wheelCounter times downwards.
Definition at line 111 of file librocketinputprocessor.h.
Referenced by processMouseWheelMotion(), and turn().