#include <src/core/input/ExtendedInputState.h>
Public Member Functions | |
bool | addHandler (InputHandler *handler) |
Adds a handler of any kind. dynamic_cast determines to which list it is added. | |
bool | addJoyStickHandler (JoyStickHandler *handler) |
Adds a joy stick handler. | |
bool | addJoyStickHandler (JoyStickHandler *handler, unsigned int joyStickID) |
Adds a joy stick handler. | |
bool | addKeyHandler (KeyHandler *handler) |
Adds a key handler. | |
bool | addMouseHandler (MouseHandler *handler) |
Adds a mouse handler. | |
bool | removeHandler (InputHandler *handler) |
Removes a handler from all lists. | |
bool | removeJoyStickHandler (JoyStickHandler *handler) |
Removes a joy stick handler from the state. | |
bool | removeJoyStickHandler (JoyStickHandler *handler, unsigned int joyStickID) |
Removes a joy stick handler from the state. | |
bool | removeKeyHandler (KeyHandler *handler) |
Removes a Key handler from the state. | |
bool | removeMouseHandler (MouseHandler *handler) |
Removes a mouse handler from the state. | |
Private Member Functions | |
ExtendedInputState () | |
void | joyStickAxisMoved (unsigned int joyStickID, unsigned int axis, float value) |
void | joyStickButtonHeld (unsigned int joyStickID, JoyStickButtonCode::ByEnum id) |
void | joyStickButtonPressed (unsigned int joyStickID, JoyStickButtonCode::ByEnum id) |
void | joyStickButtonReleased (unsigned int joyStickID, JoyStickButtonCode::ByEnum id) |
void | keyHeld (const KeyEvent &evt) |
void | keyPressed (const KeyEvent &evt) |
void | keyReleased (const KeyEvent &evt) |
void | mouseButtonHeld (MouseButtonCode::ByEnum id) |
void | mouseButtonPressed (MouseButtonCode::ByEnum id) |
void | mouseButtonReleased (MouseButtonCode::ByEnum id) |
void | mouseMoved (IntVector2 abs, IntVector2 rel, IntVector2 clippingSize) |
void | mouseScrolled (int abs, int rel) |
void | numberOfJoySticksChanged (unsigned int n) |
void | onEnter () |
void | onLeave () |
void | update () |
void | updateInput (float dt, unsigned int device) |
void | updateInput (float dt) |
void | updateTickables () |
~ExtendedInputState () | |
Private Attributes | |
std::vector< InputHandler * > | allHandlers_ |
std::vector< std::vector < JoyStickHandler * > > | joyStickHandlers_ |
std::vector< JoyStickHandler * > | joyStickHandlersAll_ |
std::vector< KeyHandler * > | keyHandlers_ |
std::vector< MouseHandler * > | mouseHandlers_ |
Friends | |
class | InputManager |
orxonox::ExtendedInputState::ExtendedInputState | ( | ) | [inline, private] |
orxonox::ExtendedInputState::~ExtendedInputState | ( | ) | [inline, private] |
bool orxonox::ExtendedInputState::addHandler | ( | InputHandler * | handler | ) |
Adds a handler of any kind. dynamic_cast determines to which list it is added.
handler | Pointer to the handler object. |
References addJoyStickHandler(), addKeyHandler(), and addMouseHandler().
bool orxonox::ExtendedInputState::addJoyStickHandler | ( | JoyStickHandler * | handler | ) |
Adds a joy stick handler.
handler | Pointer to the handler object. |
References addJoyStickHandler(), joyStickHandlers_, joyStickHandlersAll_, and update().
bool orxonox::ExtendedInputState::addJoyStickHandler | ( | JoyStickHandler * | handler, | |
unsigned int | joyStickID | |||
) |
Adds a joy stick handler.
handler | Pointer to the handler object. | |
joyStickID | ID of the joy stick |
References joyStickHandlers_, and update().
Referenced by addHandler(), and addJoyStickHandler().
bool orxonox::ExtendedInputState::addKeyHandler | ( | KeyHandler * | handler | ) |
Adds a key handler.
handler | Pointer to the handler object. |
References keyHandlers_, and update().
Referenced by addHandler().
bool orxonox::ExtendedInputState::addMouseHandler | ( | MouseHandler * | handler | ) |
Adds a mouse handler.
handler | Pointer to the handler object. |
References mouseHandlers_, and update().
Referenced by addHandler().
void orxonox::ExtendedInputState::joyStickAxisMoved | ( | unsigned int | joyStickID, | |
unsigned int | axis, | |||
float | value | |||
) | [private, virtual] |
void orxonox::ExtendedInputState::joyStickButtonHeld | ( | unsigned int | joyStickID, | |
JoyStickButtonCode::ByEnum | id | |||
) | [private, virtual] |
void orxonox::ExtendedInputState::joyStickButtonPressed | ( | unsigned int | joyStickID, | |
JoyStickButtonCode::ByEnum | id | |||
) | [private, virtual] |
void orxonox::ExtendedInputState::joyStickButtonReleased | ( | unsigned int | joyStickID, | |
JoyStickButtonCode::ByEnum | id | |||
) | [private, virtual] |
void orxonox::ExtendedInputState::keyHeld | ( | const KeyEvent & | evt | ) | [private, virtual] |
void orxonox::ExtendedInputState::keyPressed | ( | const KeyEvent & | evt | ) | [private, virtual] |
void orxonox::ExtendedInputState::keyReleased | ( | const KeyEvent & | evt | ) | [private, virtual] |
void orxonox::ExtendedInputState::mouseButtonHeld | ( | MouseButtonCode::ByEnum | id | ) | [private, virtual] |
void orxonox::ExtendedInputState::mouseButtonPressed | ( | MouseButtonCode::ByEnum | id | ) | [private, virtual] |
void orxonox::ExtendedInputState::mouseButtonReleased | ( | MouseButtonCode::ByEnum | id | ) | [private, virtual] |
void orxonox::ExtendedInputState::mouseMoved | ( | IntVector2 | abs, | |
IntVector2 | rel, | |||
IntVector2 | clippingSize | |||
) | [private, virtual] |
void orxonox::ExtendedInputState::mouseScrolled | ( | int | abs, | |
int | rel | |||
) | [private, virtual] |
void orxonox::ExtendedInputState::numberOfJoySticksChanged | ( | unsigned int | n | ) | [private, virtual] |
void orxonox::ExtendedInputState::onEnter | ( | ) | [private, virtual] |
void orxonox::ExtendedInputState::onLeave | ( | ) | [private, virtual] |
bool orxonox::ExtendedInputState::removeHandler | ( | InputHandler * | handler | ) |
Removes a handler from all lists.
handler | Pointer to the handler. |
References removeJoyStickHandler(), removeKeyHandler(), and removeMouseHandler().
bool orxonox::ExtendedInputState::removeJoyStickHandler | ( | JoyStickHandler * | handler | ) |
Removes a joy stick handler from the state.
handler | Pointer to the handler. |
References joyStickHandlers_, and removeJoyStickHandler().
bool orxonox::ExtendedInputState::removeJoyStickHandler | ( | JoyStickHandler * | handler, | |
unsigned int | joyStickID | |||
) |
Removes a joy stick handler from the state.
handler | Pointer to the handler. | |
joyStickID | ID of the joy stick |
References joyStickHandlers_, joyStickHandlersAll_, and update().
Referenced by removeHandler(), and removeJoyStickHandler().
bool orxonox::ExtendedInputState::removeKeyHandler | ( | KeyHandler * | handler | ) |
Removes a Key handler from the state.
handler | Pointer to the handler. |
References keyHandlers_, and update().
Referenced by removeHandler().
bool orxonox::ExtendedInputState::removeMouseHandler | ( | MouseHandler * | handler | ) |
Removes a mouse handler from the state.
handler | Pointer to the handler. |
References mouseHandlers_, and update().
Referenced by removeHandler().
void orxonox::ExtendedInputState::update | ( | ) | [private] |
References allHandlers_, orxonox::InputState::bHandlersChanged_, joyStickHandlers_, orxonox::InputDevice::Keyboard, keyHandlers_, orxonox::InputDevice::Mouse, mouseHandlers_, and orxonox::InputState::setInputDeviceEnabled().
Referenced by addJoyStickHandler(), addKeyHandler(), addMouseHandler(), numberOfJoySticksChanged(), removeJoyStickHandler(), removeKeyHandler(), and removeMouseHandler().
void orxonox::ExtendedInputState::updateInput | ( | float | dt, | |
unsigned int | device | |||
) | [private, virtual] |
Implements orxonox::InputState.
References joyStickHandlers_, orxonox::InputDevice::Keyboard, keyHandlers_, orxonox::InputDevice::Mouse, and mouseHandlers_.
void orxonox::ExtendedInputState::updateInput | ( | float | dt | ) | [private, virtual] |
void orxonox::ExtendedInputState::updateTickables | ( | ) | [private] |
friend class InputManager [friend] |
Reimplemented from orxonox::InputState.
std::vector<InputHandler*> orxonox::ExtendedInputState::allHandlers_ [private] |
Referenced by update(), and updateInput().
std::vector<std::vector<JoyStickHandler*> > orxonox::ExtendedInputState::joyStickHandlers_ [private] |
std::vector<JoyStickHandler*> orxonox::ExtendedInputState::joyStickHandlersAll_ [private] |
Referenced by addJoyStickHandler(), numberOfJoySticksChanged(), and removeJoyStickHandler().
std::vector<KeyHandler*> orxonox::ExtendedInputState::keyHandlers_ [private] |
Referenced by addKeyHandler(), keyHeld(), keyPressed(), keyReleased(), removeKeyHandler(), update(), and updateInput().
std::vector<MouseHandler*> orxonox::ExtendedInputState::mouseHandlers_ [private] |