SDL++
C++wrapperfortheSDLlibrary.
|
Represents a joystick. More...
#include <Joystick.h>
Public Member Functions | |
Joystick (int index) | |
~Joystick () | |
std::string | name () |
int | index () |
int | numAxes () |
int | numButtons () |
int | numHats () |
int | numTrackballs () |
short | axisPosition (int axis) |
bool | isPressed (int button) |
char | hatState (int hat) |
pair< int, int > | trackballMotion (int trackball) |
Represents a joystick.
Definition at line 41 of file Joystick.h.
sdl::devices::Joystick::Joystick | ( | int | index | ) | [inline] |
Constructs a Joystick.
index | The index of the joystick. |
Definition at line 48 of file Joystick.h.
sdl::devices::Joystick::~Joystick | ( | ) | [inline] |
Destroy a Joystick.
Definition at line 58 of file Joystick.h.
short sdl::devices::Joystick::axisPosition | ( | int | axis | ) | [inline] |
Returns the position of the given joystick axis.
axis | The axis. |
Definition at line 109 of file Joystick.h.
char sdl::devices::Joystick::hatState | ( | int | hat | ) | [inline] |
Returns the state of the given joystick hat.
hat | The hat. |
Definition at line 127 of file Joystick.h.
int sdl::devices::Joystick::index | ( | ) | [inline] |
Returns the index of the joystick.
Definition at line 72 of file Joystick.h.
bool sdl::devices::Joystick::isPressed | ( | int | button | ) | [inline] |
Determines if the button is pressed.
button | The button. |
Definition at line 118 of file Joystick.h.
std::string sdl::devices::Joystick::name | ( | ) | [inline] |
Gets the implementation dependent name of the joystick.
Definition at line 65 of file Joystick.h.
int sdl::devices::Joystick::numAxes | ( | ) | [inline] |
Gets the number of joystick axes.
return The number of joystick axes.
Definition at line 79 of file Joystick.h.
int sdl::devices::Joystick::numButtons | ( | ) | [inline] |
Gets the number of joystick buttons.
return The number of joystick buttons.
Definition at line 86 of file Joystick.h.
int sdl::devices::Joystick::numHats | ( | ) | [inline] |
Gets the number of joystick hats.
return The number of joystick hats.
Definition at line 93 of file Joystick.h.
int sdl::devices::Joystick::numTrackballs | ( | ) | [inline] |
Gets the number of joystick trackballs.
return The number of joystick trackballs.
Definition at line 100 of file Joystick.h.
pair<int, int> sdl::devices::Joystick::trackballMotion | ( | int | trackball | ) | [inline] |
Returns the relative motion of the given joystick trackball.
trackball | The trackball. |
runtime_error | Throws a runtime_error if unable to determine trackball motion. |
Definition at line 138 of file Joystick.h.