dtCore::Keyboard Class Reference

The model of the keyboard used throughout Delta3D. More...

#include <keyboard.h>

Inheritance diagram for dtCore::Keyboard:

dtCore::InputDevice dtCore::Base

List of all members.

Public Types

typedef std::list
< dtCore::RefPtr
< KeyboardListener > > 
KeyboardListenerList

Public Member Functions

 Keyboard (const std::string &name="keyboard")
 Registers many Buttons as DeviceFeatures with the base class, InputDevice.
bool GetKeyState (int key) const
 Checks the state of the specified key.
void AddKeyboardListener (KeyboardListener *keyboardListener)
 Pushes a listener for keyboard events to the back of the container.
void InsertKeyboardListener (const KeyboardListenerList::value_type &pos, KeyboardListener *kbl)
 Inserts the listener into the list at a position BEFORE pos.
void RemoveKeyboardListener (KeyboardListener *keyboardListener)
 Removes a keyboard listener.
virtual bool KeyDown (int key)
virtual bool KeyUp (int key)
const KeyboardListenerListGetListeners () const
 
Returns:
The container of listeners.


Protected Member Functions

virtual ~Keyboard ()
 Deregisters itself with the instance management layer.

Protected Attributes

KeyboardListenerList mKeyboardListeners
 The container of keyboard listeners.


Detailed Description

The model of the keyboard used throughout Delta3D.

Member Typedef Documentation

typedef std::list<dtCore::RefPtr<KeyboardListener> > dtCore::Keyboard::KeyboardListenerList


Constructor & Destructor Documentation

Keyboard::Keyboard ( const std::string &  name = "keyboard"  ) 

Registers many Buttons as DeviceFeatures with the base class, InputDevice.

It also registers itself with the instance management layer.

Parameters:
name the instance name

Keyboard::~Keyboard (  )  [protected, virtual]

Deregisters itself with the instance management layer.


Member Function Documentation

bool Keyboard::GetKeyState ( int  key  )  const

Checks the state of the specified key.

Parameters:
key the key to check
Returns:
true if the key is being held down, false otherwise

void Keyboard::AddKeyboardListener ( KeyboardListener keyboardListener  ) 

Pushes a listener for keyboard events to the back of the container.

Parameters:
keyboardListener the listener to add

void Keyboard::InsertKeyboardListener ( const KeyboardListenerList::value_type &  pos,
KeyboardListener kbl 
)

Inserts the listener into the list at a position BEFORE pos.

void Keyboard::RemoveKeyboardListener ( KeyboardListener keyboardListener  ) 

Removes a keyboard listener.

Parameters:
keyboardListener the listener to remove from the container of listeners.

bool Keyboard::KeyDown ( int  key  )  [virtual]

bool Keyboard::KeyUp ( int  key  )  [virtual]

const KeyboardListenerList& dtCore::Keyboard::GetListeners (  )  const [inline]

Returns:
The container of listeners.


Member Data Documentation

KeyboardListenerList dtCore::Keyboard::mKeyboardListeners [protected]

The container of keyboard listeners.


http://www.delta3d.org
2.0.0 generated 14 Feb 2008