|
direcs
2012-09-30
|
This class is for controling the robot with a joystick. More...
#include <joystick.h>
Signals | |
| void | joystickButtonPressed (int axisNumber, bool buttonState) |
| void | joystickMoved (int axisNumber, int axisValue) |
| void | joystickPOVButtonPressed (int buttonsState) |
| void | message (QString text) |
Public Member Functions | |
| bool | isConnected () |
| Joystick () | |
| virtual void | run () |
| void | setPort (QString port) |
| void | stop () |
| ~Joystick () | |
Private Attributes | |
| QString | joystickPort |
| volatile bool | stopped |
Static Private Attributes | |
| static const int | JOYSTICKAXISX3 = 3 |
| static const int | JOYSTICKAXISX4 = 4 |
| static const int | JOYSTICKAXISY2 = 2 |
| static const int | JOYSTICKAXISY5 = 5 |
| static const unsigned long | THREADSLEEPTIME = 250 |
This class is for controling the robot with a joystick.
Definition at line 58 of file joystick.h.
| Joystick::Joystick | ( | ) |
Definition at line 25 of file joystick.cpp.
| Joystick::~Joystick | ( | ) |
Definition at line 35 of file joystick.cpp.
| bool Joystick::isConnected | ( | void | ) |
Returns the state of a connected joystick.
Definition at line 255 of file joystick.cpp.


|
signal |
Emits a signal when an joystick button-pressed event occured.
| axisNumber | is the number of the joysticks button |
| buttonState | is the buttons state (true when button is down) |

|
signal |
Emits a signal when an joystick move event occured.
| axisNumber | is the number of the joysticks axis |
| axisValue | is the axis value |

|
signal |
Emits a signal when a POV / hat switch joystick button-pressed event occured.
| buttonsState | is the buttons state (normally 0 to 8 on a POV / hat switch) And this is the POV button layout: 1 8 2 7 0 3 6 4 5 |

|
signal |
Emits a info or error message to a slot. This slot can be used to display a text on a splash screen, log file, to print it to a console...
| text | is the message to be emitted |

|
virtual |
| void Joystick::setPort | ( | QString | port | ) |
Sets the joystick port.
| port | is the joystick port (e.g. /dev/input/js0) |
Definition at line 286 of file joystick.cpp.

| void Joystick::stop | ( | ) |
|
staticprivate |
Definition at line 145 of file joystick.h.
|
staticprivate |
Definition at line 146 of file joystick.h.
|
staticprivate |
Joystick axis numbers
Definition at line 144 of file joystick.h.
|
staticprivate |
Definition at line 147 of file joystick.h.
|
private |
Definition at line 120 of file joystick.h.
|
private |
Definition at line 119 of file joystick.h.
|
staticprivate |
Definition at line 139 of file joystick.h.