Deadalus
Public Member Functions | Private Member Functions | Private Attributes
Joystick Class Reference

Represents a joystick device. Allows data to be sampled from it. More...

#include <joystick.hh>

List of all members.

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

Detailed Description

Represents a joystick device. Allows data to be sampled from it.


Constructor & Destructor Documentation

Initialises an instance for the first joystick: /dev/input/js0.

Initialises an instance for the joystick with the specified, zero-indexed number.


The documentation for this class was generated from the following files:
 All Classes Functions Variables