Deadalus
|
Represents a joystick device. Allows data to be sampled from it. More...
#include <joystick.hh>
Public Member Functions | |
Joystick () | |
Initialises an instance for the first joystick: /dev/input/js0. | |
Joystick (int joystickNumber) | |
Joystick (std::string devicePath) | |
Initialises an instance for the joystick device specified. | |
bool | isFound () |
Returns true if the joystick was found and may be used, otherwise false. | |
bool | sample (JoystickEvent *event) |
Attempts to populate the provided JoystickEvent instance with data from the joystick. Returns true if data is available, otherwise false. | |
Private Member Functions | |
void | openPath (std::string devicePath) |
Private Attributes | |
int | _fd |
Represents a joystick device. Allows data to be sampled from it.
Initialises an instance for the first joystick: /dev/input/js0.
Initialises an instance for the joystick with the specified, zero-indexed number.