#include <inputdevice.hpp>
Inheritance diagram for InputDevice:
Public Member Functions | |
InputDevice () | |
Constructor. | |
virtual | ~InputDevice () |
Destructor. | |
void | startPolling () |
Start polling of input device. | |
void | stopPolling () |
Stop polling of input device. | |
Protected Member Functions | |
virtual void | run () |
Main method of input device thread. | |
virtual bool | poll () |
If any button was pressed poll() gives a signal to the handler and creates afterwards a reaction record if the reaction was valid. | |
virtual bool | handle (vector< bool > &states) |
Checks if the reaction was valid. | |
Protected Attributes | |
bool | active |
state flag |
A input device polls devices like mouse or keyboard for user reactions.
Definition at line 31 of file inputdevice.hpp.
|
Constructor. Definition at line 29 of file inputdevice.cpp. References active. |
|
Destructor. Definition at line 36 of file inputdevice.cpp. |
|
Checks if the reaction was valid.
Reimplemented in JoystickInputDevice, KeyboardInputDevice, and MouseInputDevice. Definition at line 105 of file inputdevice.cpp. Referenced by run(). |
|
If any button was pressed poll() gives a signal to the handler and creates afterwards a reaction record if the reaction was valid.
Reimplemented in JoystickInputDevice, KeyboardInputDevice, and MouseInputDevice. Definition at line 98 of file inputdevice.cpp. Referenced by run(). |
|
Main method of input device thread. This method polls input devices via the poll() method and if necessary measures the time in which a event has happened. Then the handle() method is called which checks if an event is a valid reaction or not. If it is valid a ReactionRecord is inserted in the reaction queue. Reimplemented in SimulatedInputDevice. Definition at line 48 of file inputdevice.cpp. References active, PtfCore::getEventLog(), PtfCore::getReactionRecords(), PtfCore::getReactionRecordsMutex(), Singleton< PtfCore >::getSingleton(), handle(), TimeInterval::measureA(), TimeInterval::measureB(), poll(), and TimeInterval::toString(). Here is the call graph for this function: ![]() |
|
Start polling of input device. Definition at line 112 of file inputdevice.cpp. References active. |
|
Stop polling of input device. Definition at line 120 of file inputdevice.cpp. References active. |
|
state flag Definition at line 33 of file inputdevice.hpp. Referenced by InputDevice(), run(), startPolling(), and stopPolling(). |