#include <inputmapper.h>

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. | |
| InputDevice * | GetDevice (int index) |
| Returns the device at the specified index. | |
| void | SetCancelButton (Button *button) |
| Sets the cancel button. | |
| Button * | GetCancelButton () |
| 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. | |
| dtCore::InputMapper::InputMapper | ( | const std::string & | name = "InputMapper" |
) |
Constructor.
| name | the instance name |
| dtCore::InputMapper::~InputMapper | ( | ) | [protected, virtual] |
Destructor.
| void dtCore::InputMapper::AddDevice | ( | InputDevice * | device | ) |
Adds an input device to this mapper.
| device | the device to add |
| void dtCore::InputMapper::RemoveDevice | ( | InputDevice * | device | ) |
Removes an input device from this mapper.
| device | the device to remove |
| int dtCore::InputMapper::GetNumDevices | ( | ) |
Returns the number of devices watched by this mapper.
| InputDevice * dtCore::InputMapper::GetDevice | ( | int | index | ) |
Returns the device at the specified index.
| index | the index |
| void dtCore::InputMapper::SetCancelButton | ( | Button * | button | ) |
Sets the cancel button.
| button | the cancel button |
| Button * dtCore::InputMapper::GetCancelButton | ( | ) |
Returns the cancel button.
| bool dtCore::InputMapper::AcquireButtonMapping | ( | InputMapperCallback * | callback | ) |
Acquires a button mapping.
| callback | the callback interface, used to report the result |
| bool dtCore::InputMapper::AcquireAxisMapping | ( | InputMapperCallback * | callback | ) |
Acquires an axis mapping.
| callback | the callback interface, used to report the result |
| bool dtCore::InputMapper::ButtonStateChanged | ( | const Button * | button, | |
| bool | oldState, | |||
| bool | newState | |||
| ) | [protected, virtual] |
Called when a button's state has changed.
| 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.
| 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.