dtCore::InputMapper Class Reference

Acquires mappings for logical input device features by listening to a set of devices. More...

#include <inputmapper.h>

Inheritance diagram for dtCore::InputMapper:

dtCore::Base dtCore::ButtonListener dtCore::AxisListener

List of all members.

Public Member Functions

 InputMapper (const std::string &name="InputMapper")
 Constructor.
void AddDevice (InputDevice *device)
 Adds an input device to this mapper.
void RemoveDevice (InputDevice *device)
 Removes an input device from this mapper.
int GetNumDevices ()
 Returns the number of devices watched by this mapper.
InputDeviceGetDevice (int index)
 Returns the device at the specified index.
void SetCancelButton (Button *button)
 Sets the cancel button.
ButtonGetCancelButton ()
 Returns the cancel button.
bool AcquireButtonMapping (InputMapperCallback *callback)
 Acquires a button mapping.
bool AcquireAxisMapping (InputMapperCallback *callback)
 Acquires an axis mapping.

Protected Member Functions

virtual ~InputMapper ()
 Destructor.
virtual bool ButtonStateChanged (const Button *button, bool oldState, bool newState)
 Called when a button's state has changed.
virtual bool AxisStateChanged (const Axis *axis, double oldState, double newState, double delta)
 Called when an axis' state has changed.


Detailed Description

Acquires mappings for logical input device features by listening to a set of devices.

Constructor & Destructor Documentation

dtCore::InputMapper::InputMapper ( const std::string &  name = "InputMapper"  ) 

Constructor.

Parameters:
name the instance name

dtCore::InputMapper::~InputMapper (  )  [protected, virtual]

Destructor.


Member Function Documentation

void dtCore::InputMapper::AddDevice ( InputDevice device  ) 

Adds an input device to this mapper.

Parameters:
device the device to add

void dtCore::InputMapper::RemoveDevice ( InputDevice device  ) 

Removes an input device from this mapper.

Parameters:
device the device to remove

int dtCore::InputMapper::GetNumDevices (  ) 

Returns the number of devices watched by this mapper.

Returns:
the number of devices

InputDevice * dtCore::InputMapper::GetDevice ( int  index  ) 

Returns the device at the specified index.

Parameters:
index the index
Returns:
the device at the index

void dtCore::InputMapper::SetCancelButton ( Button button  ) 

Sets the cancel button.

Parameters:
button the cancel button

Button * dtCore::InputMapper::GetCancelButton (  ) 

Returns the cancel button.

Returns:
the cancel button

bool dtCore::InputMapper::AcquireButtonMapping ( InputMapperCallback callback  ) 

Acquires a button mapping.

Parameters:
callback the callback interface, used to report the result
Returns:
true if the acquisition process was initiated, false if an acquisition is already taking place

bool dtCore::InputMapper::AcquireAxisMapping ( InputMapperCallback callback  ) 

Acquires an axis mapping.

Parameters:
callback the callback interface, used to report the result
Returns:
true if the acquisition process was initiated, false if an acquisition is already taking place

bool dtCore::InputMapper::ButtonStateChanged ( const Button button,
bool  oldState,
bool  newState 
) [protected, virtual]

Called when a button's state has changed.

Parameters:
button the origin of the event
oldState the old state of the button
newState the new state of the button

Implements dtCore::ButtonListener.

bool dtCore::InputMapper::AxisStateChanged ( const Axis axis,
double  oldState,
double  newState,
double  delta 
) [protected, virtual]

Called when an axis' state has changed.

Parameters:
axis the changed axis
oldState the old state of the axis
newState the new state of the axis
delta a delta value indicating stateless motion

Implements dtCore::AxisListener.


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