Orxonox  0.0.5 Codename: Arcturus
Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | Friends | List of all members
orxonox::Keyboard Class Reference

Wraps around an OIS::Mouse and forwards the input events to a list of input states. More...

#include </home/jenkins/workspace/orxonox_doxygen_trunk/src/libraries/core/input/Keyboard.h>

Inheritance diagram for orxonox::Keyboard:
orxonox::InputDeviceTemplated< KeyboardTraits > OIS::KeyListener orxonox::InputDevice

Public Member Functions

 Keyboard (unsigned int id, OIS::InputManager *oisInputManager)
 Only resets the keyboard modifiers. Initialising is done in the base class. More...
 
 ~Keyboard ()=default
 
- Public Member Functions inherited from orxonox::InputDeviceTemplated< KeyboardTraits >
 InputDeviceTemplated (unsigned int id, OIS::InputManager *oisInputManager)
 Creates the OIS device. More...
 
virtual ~InputDeviceTemplated ()
 Destroys the OIS device. More...
 
virtual void clearBuffers () override
 Clears the list of pressed buttons and calls the derived class's method. More...
 
virtual std::string getClassName () const override
 Returns the device class (derived) name as string. More...
 
OISDeviceClassgetOISDevice ()
 
virtual void update (const Clock &time) override
 Captures OIS events (which then get distributed to the derived class) and creates the button held events. More...
 
- Public Member Functions inherited from orxonox::InputDevice
 InputDevice (unsigned int id)
 Only resets the members. More...
 
virtual ~InputDevice ()=default
 
unsigned int getDeviceID () const
 Returns the ID of the device (the same as in InputDeviceEnumerator for mouse and keyboard) More...
 
std::vector< InputState * > & getStateListRef ()
 Returns a reference to the internal input state vector. Use with care! More...
 
bool isCalibrating () const
 Tells whether the device is in calibration mode. More...
 
void startCalibration ()
 Start calibrating (only useful for joy sticks) More...
 
void stopCalibration ()
 Stop calibrating and evaluate the data (only useful for joy sticks) More...
 
- Public Member Functions inherited from OIS::KeyListener
virtual ~KeyListener ()
 

Private Types

typedef InputDeviceTemplated< KeyboardTraitssuper
 Super class alias. More...
 

Private Member Functions

void clearBuffersImpl ()
 Resets the keyboard modifiers. More...
 
KeyEventgetButtonEventArg (KeyEvent &button)
 Translates the KeyHandle to a KeyEvent. More...
 
virtual bool keyPressed (const OIS::KeyEvent &arg) override
 OIS event handler. More...
 
virtual bool keyReleased (const OIS::KeyEvent &arg) override
 OIS event handler. More...
 

Static Private Member Functions

static std::string getClassNameImpl ()
 Returns the class name as string. More...
 
static unsigned int getKeyText (const OIS::KeyEvent &arg)
 A map which returns the corresponding chars for some key codes. More...
 

Private Attributes

int modifiers_
 Bit mask representing keyboard modifiers. More...
 

Friends

class InputDeviceTemplated< KeyboardTraits >
 

Additional Inherited Members

- Protected Member Functions inherited from orxonox::InputDeviceTemplated< KeyboardTraits >
ORX_FORCEINLINE void buttonPressed (ButtonTypeParam button)
 Common code for all button pressed events (updates pressed buttons list and calls the input states) More...
 
ORX_FORCEINLINE void buttonReleased (ButtonTypeParam button)
 Common code for all button released events (updates pressed buttons list and calls the input states) More...
 
- Protected Member Functions inherited from orxonox::InputDevice
virtual void calibrationStarted ()
 To be ovrridden by the subclass. More...
 
virtual void calibrationStopped ()
 To be ovrridden by the subclass. More...
 
- Protected Attributes inherited from orxonox::InputDeviceTemplated< KeyboardTraits >
OISDeviceClassoisDevice_
 Managed pointer to the OIS device. More...
 
- Protected Attributes inherited from orxonox::InputDevice
std::vector< InputState * > inputStates_
 List of all input states that receive events from this device. More...
 

Detailed Description

Wraps around an OIS::Mouse and forwards the input events to a list of input states.

It also saves the state of the keyboard modifiers (like shift, etc.)

Member Typedef Documentation

Super class alias.

Constructor & Destructor Documentation

orxonox::Keyboard::Keyboard ( unsigned int  id,
OIS::InputManager oisInputManager 
)
inline

Only resets the keyboard modifiers. Initialising is done in the base class.

orxonox::Keyboard::~Keyboard ( )
default

Member Function Documentation

void orxonox::Keyboard::clearBuffersImpl ( )
inlineprivate

Resets the keyboard modifiers.

KeyEvent& orxonox::Keyboard::getButtonEventArg ( KeyEvent button)
inlineprivate

Translates the KeyHandle to a KeyEvent.

static std::string orxonox::Keyboard::getClassNameImpl ( )
inlinestaticprivate

Returns the class name as string.

unsigned int orxonox::Keyboard::getKeyText ( const OIS::KeyEvent arg)
staticprivate

A map which returns the corresponding chars for some key codes.

bool orxonox::Keyboard::keyPressed ( const OIS::KeyEvent arg)
overrideprivatevirtual

OIS event handler.

Implements OIS::KeyListener.

bool orxonox::Keyboard::keyReleased ( const OIS::KeyEvent arg)
overrideprivatevirtual

OIS event handler.

Implements OIS::KeyListener.

Friends And Related Function Documentation

friend class InputDeviceTemplated< KeyboardTraits >
friend

Member Data Documentation

int orxonox::Keyboard::modifiers_
private

Bit mask representing keyboard modifiers.


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