#include <JoystickReader.h>
Public Member Functions | |
JoystickReader (const std::string &path, std::string configToUse="") | |
JoystickReader (const labust::xml::Reader &reader, std::string configToUse="") | |
JoystickData | ReadJoystickData () |
virtual | ~JoystickReader () |
Private Attributes | |
int | axes |
std::vector< float > | axisGains |
int | buttons |
int | deviceCounter |
int | deviceDescriptor |
JoystickData | joystickData |
Represents a joystick device. Has methods to update state of stick in realtime and to extract data in the JoystickData structure
Data can be sampled from joystick using ReadJoystickData function at any frequency.
Definition at line 51 of file JoystickReader.h.
LABUST::JoystickReader::JoystickReader | ( | const std::string & | path, |
std::string | configToUse = "" |
||
) |
Creates a new instance of the joystick class Opens the specified joystick device and loads number of axes and buttons from driver
Definition at line 35 of file JoystickReaderLinux.cpp.
LABUST::JoystickReader::JoystickReader | ( | const labust::xml::Reader & | reader, |
std::string | configToUse = "" |
||
) |
Creates a new instance of the joystick class Opens the first joystick device and uses number of axes and buttons specified by user
Definition at line 139 of file JoystickReaderLinux.cpp.
LABUST::JoystickReader::~JoystickReader | ( | ) | [virtual] |
Definition at line 208 of file JoystickReaderLinux.cpp.
Returnd data about the current state of joystick
Definition at line 222 of file JoystickReaderLinux.cpp.
int LABUST::JoystickReader::axes [private] |
Definition at line 81 of file JoystickReader.h.
std::vector<float> LABUST::JoystickReader::axisGains [private] |
Definition at line 83 of file JoystickReader.h.
int LABUST::JoystickReader::buttons [private] |
Definition at line 81 of file JoystickReader.h.
int LABUST::JoystickReader::deviceCounter [private] |
Definition at line 99 of file JoystickReader.h.
int LABUST::JoystickReader::deviceDescriptor [private] |
Definition at line 80 of file JoystickReader.h.
Definition at line 82 of file JoystickReader.h.