Orxonox: orxonox::SimpleInputState Class Reference

# orxonox::SimpleInputState Class Reference

`#include <src/core/input/SimpleInputState.h>`

Inheritance diagram for orxonox::SimpleInputState:

List of all members.

## Public Member Functions

bool | setHandler (InputHandler *handler)
| Adds a handler of any kind. dynamic_cast determines to which list it is added.
bool | setJoyStickHandler (JoyStickHandler *handler)
| Adds a joy stick handler.
bool | setJoyStickHandler (JoyStickHandler *handler, unsigned int joyStickID)
| Adds a joy stick handler.
void | setKeyHandler (KeyHandler *handler)
void | setMouseHandler (MouseHandler *handler)

## Private Member Functions

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 ()
| SimpleInputState ()
void | update ()
void | updateInput (float dt, unsigned int device)
void | updateInput (float dt)
| ~SimpleInputState ()

## Private Attributes

std::vector< InputHandler * > | allHandlers_
std::vector< JoyStickHandler * > | joyStickHandler_
JoyStickHandler * | joyStickHandlerAll_
KeyHandler * | keyHandler_
MouseHandler * | mouseHandler_

## Friends

class | InputManager

## Constructor & Destructor Documentation

orxonox::SimpleInputState::SimpleInputState | ( |  | ) | `[private]`

orxonox::SimpleInputState::~SimpleInputState | ( |  | ) | `[inline, private]`

## Member Function Documentation

void orxonox::SimpleInputState::joyStickAxisMoved | ( | unsigned int | joyStickID,
|  | unsigned int | axis,
|  | float | value |
| ) |  |  | `[inline, private, virtual]`

Implements orxonox::InputState.

References joyStickHandler_.

void orxonox::SimpleInputState::joyStickButtonHeld | ( | unsigned int | joyStickID,
|  | JoyStickButtonCode::ByEnum | id |
| ) |  |  | `[inline, private, virtual]`

Implements orxonox::InputState.

References joyStickHandler_.

void orxonox::SimpleInputState::joyStickButtonPressed | ( | unsigned int | joyStickID,
|  | JoyStickButtonCode::ByEnum | id |
| ) |  |  | `[inline, private, virtual]`

Implements orxonox::InputState.

References joyStickHandler_.

void orxonox::SimpleInputState::joyStickButtonReleased | ( | unsigned int | joyStickID,
|  | JoyStickButtonCode::ByEnum | id |
| ) |  |  | `[inline, private, virtual]`

Implements orxonox::InputState.

References joyStickHandler_.

void orxonox::SimpleInputState::keyHeld | ( | const KeyEvent & | evt | ) | `[inline, private, virtual]`

Implements orxonox::InputState.

References keyHandler_, and orxonox::KeyHandler::keyHeld().

void orxonox::SimpleInputState::keyPressed | ( | const KeyEvent & | evt | ) | `[private, virtual]`

Implements orxonox::InputState.

References keyHandler_, and orxonox::KeyHandler::keyPressed().

void orxonox::SimpleInputState::keyReleased | ( | const KeyEvent & | evt | ) | `[inline, private, virtual]`

Implements orxonox::InputState.

References keyHandler_, and orxonox::KeyHandler::keyReleased().

void orxonox::SimpleInputState::mouseButtonHeld | ( | MouseButtonCode::ByEnum | id | ) | `[inline, private, virtual]`

Implements orxonox::InputState.

References orxonox::MouseHandler::mouseButtonHeld(), and mouseHandler_.

void orxonox::SimpleInputState::mouseButtonPressed | ( | MouseButtonCode::ByEnum | id | ) | `[inline, private, virtual]`

Implements orxonox::InputState.

References orxonox::MouseHandler::mouseButtonPressed(), and mouseHandler_.

void orxonox::SimpleInputState::mouseButtonReleased | ( | MouseButtonCode::ByEnum | id | ) | `[inline, private, virtual]`

Implements orxonox::InputState.

References orxonox::MouseHandler::mouseButtonReleased(), and mouseHandler_.

void orxonox::SimpleInputState::mouseMoved | ( | IntVector2 | abs,
|  | IntVector2 | rel,
|  | IntVector2 | clippingSize |
| ) |  |  | `[inline, private, virtual]`

Implements orxonox::InputState.

References mouseHandler_, and orxonox::MouseHandler::mouseMoved().

void orxonox::SimpleInputState::mouseScrolled | ( | int | abs,
|  | int | rel |
| ) |  |  | `[inline, private, virtual]`

Implements orxonox::InputState.

References mouseHandler_, and orxonox::MouseHandler::mouseScrolled().

void orxonox::SimpleInputState::numberOfJoySticksChanged | ( | unsigned int | n | ) | `[private, virtual]`

Implements orxonox::InputState.

References joyStickHandler_, joyStickHandlerAll_, and update().

void orxonox::SimpleInputState::onEnter | ( |  | ) | `[private, virtual]`

Implements orxonox::InputState.

References orxonox::InputState::executorOnEnter_.

void orxonox::SimpleInputState::onLeave | ( |  | ) | `[private, virtual]`

Implements orxonox::InputState.

References orxonox::InputState::executorOnLeave_.

bool orxonox::SimpleInputState::setHandler | ( | InputHandler * | handler | ) |

Adds a handler of any kind. dynamic_cast determines to which list it is added.

Parameters:

  | handler | Pointer to the handler object.

Returns:
  True if added, false if handler already existed.

References setJoyStickHandler(), setKeyHandler(), and setMouseHandler().

Referenced by orxonox::GSMainMenu::activate(), orxonox::GSLevel::activate(), orxonox::GSLevel::deactivate(), orxonox::GSGraphics::deactivate(), and orxonox::InputManager::initialise().

bool orxonox::SimpleInputState::setJoyStickHandler | ( | JoyStickHandler * | handler | ) |

Adds a joy stick handler.

Parameters:

  | handler | Pointer to the handler object.

Returns:
  True if added, false if handler already existed.

References joyStickHandler_, joyStickHandlerAll_, setJoyStickHandler(), and update().

bool orxonox::SimpleInputState::setJoyStickHandler | ( | JoyStickHandler * | handler,
|  | unsigned int | joyStickID |
| ) |  |  |

Adds a joy stick handler.

Parameters:

  | handler | Pointer to the handler object.
  | joyStickID | ID of the joy stick

Returns:
  True if added, false otherwise.

References joyStickHandler_, and update().

Referenced by orxonox::GSMainMenu::activate(), orxonox::InGameConsole::bHidesAllInputChanged(), setHandler(), and setJoyStickHandler().

void orxonox::SimpleInputState::setKeyHandler | ( | KeyHandler * | handler | ) | `[inline]`

Referenced by orxonox::GSLevel::activate(), orxonox::GSGraphics::activate(), orxonox::InGameConsole::initialise(), orxonox::InputManager::initialise(), and setHandler().

void orxonox::SimpleInputState::setMouseHandler | ( | MouseHandler * | handler | ) | `[inline]`

Referenced by orxonox::GSLevel::activate(), orxonox::InGameConsole::bHidesAllInputChanged(), and setHandler().

void orxonox::SimpleInputState::update | ( |  | ) | `[private]`

References allHandlers_, orxonox::InputState::bHandlersChanged_, joyStickHandler_, orxonox::InputDevice::Keyboard, keyHandler_, orxonox::InputDevice::Mouse, mouseHandler_, and orxonox::InputState::setInputDeviceEnabled().

Referenced by numberOfJoySticksChanged(), and setJoyStickHandler().

void orxonox::SimpleInputState::updateInput | ( | float | dt,
|  | unsigned int | device |
| ) |  |  | `[inline, private, virtual]`

Implements orxonox::InputState.

References joyStickHandler_, orxonox::InputDevice::Keyboard, keyHandler_, orxonox::InputDevice::Mouse, mouseHandler_, orxonox::KeyHandler::updateKey(), and orxonox::MouseHandler::updateMouse().

void orxonox::SimpleInputState::updateInput | ( | float | dt | ) | `[inline, private, virtual]`

Implements orxonox::InputState.

References allHandlers_.

## Friends And Related Function Documentation

friend class InputManager`[friend]`

Reimplemented from orxonox::InputState.

## Member Data Documentation

std::vector<InputHandler*> orxonox::SimpleInputState::allHandlers_`[private]`

Referenced by update(), and updateInput().

std::vector<JoyStickHandler*> orxonox::SimpleInputState::joyStickHandler_`[private]`

Referenced by joyStickAxisMoved(), joyStickButtonHeld(), joyStickButtonPressed(), joyStickButtonReleased(), numberOfJoySticksChanged(), setJoyStickHandler(), update(), and updateInput().

JoyStickHandler* orxonox::SimpleInputState::joyStickHandlerAll_`[private]`

Referenced by numberOfJoySticksChanged(), and setJoyStickHandler().

KeyHandler* orxonox::SimpleInputState::keyHandler_`[private]`

Referenced by keyHeld(), keyPressed(), keyReleased(), update(), and updateInput().

MouseHandler* orxonox::SimpleInputState::mouseHandler_`[private]`

Referenced by mouseButtonHeld(), mouseButtonPressed(), mouseButtonReleased(), mouseMoved(), mouseScrolled(), update(), and updateInput().

The documentation for this class was generated from the following files:

- src/core/input/SimpleInputState.h
- src/core/input/SimpleInputState.cc