Simple listener for JoyStick events. More...
#include <Devices/JoyStick.H>
Public Member Functions | |
virtual | ~JoyStickListener () |
Destructor. | |
virtual void | axis (const uint num, const int16 val)=0 |
An axis changed. | |
virtual void | button (const uint num, const bool state)=0 |
A button changed. |
Simple listener for JoyStick events.
The JoyStickListener gets called each time an event is received from the JoyStick. By default, there is no listener, and users can just asynchronously query the JoyStick for its current internal state. If those queries come in too slowly, however, they may miss some events (e.g., a briefly pressed button). So, production code should define a derived class for JoyStickListener and register it with the JoyStick object, so that it will take action as soon as an event is received.
Definition at line 57 of file JoyStick.H.
JoyStickListener::~JoyStickListener | ( | ) | [virtual] |
Destructor.
Definition at line 47 of file JoyStick.C.
An axis changed.
num | axis number | |
val | new axis value |
Implemented in TestJoyStickListener, TestJoyStickListener, TestJoyStickListener, TestJoyStickListener, and TestJoyStickListener.
virtual void JoyStickListener::button | ( | const uint | num, | |
const bool | state | |||
) | [pure virtual] |
A button changed.
num | button number | |
state | new button state (true = pressed) |
Implemented in TestJoyStickListener, TestJoyStickListener, TestJoyStickListener, TestJoyStickListener, and TestJoyStickListener.