Implements a joystick with last state checking ability.
More...
#include <DebouncedJoystick.h>
|
void | Init () |
| Initializes the values of the joystick.
|
|
void | Update () |
| Updates the values of the joystick.
|
|
bool | ButtonInBounds (int button) |
| Checks if a button is in bounds.
|
|
bool | AxisInBounds (int axis) |
| Checks if an axis is in bounds.
|
|
bool | IsButtonJustPressed (int button) |
| Returns whether a button is first pressed in the current cycle.
|
|
bool | IsButtonJustReleased (int button) |
| Returns whether a button is first released in the current cycle.
|
|
bool | IsButtonDown (int button) |
| Returns if the button is down.
|
|
bool | WasButtonDown (int button) |
| Returns if the button was down in the previous cycle.
|
|
bool | IsHatSwitchJustPressed (int axis, int direction) |
| Returns if the hat switch is first pressed in the current cycle.
|
|
bool | IsHatSwitchJustReleased (int axis, int direction) |
| Returns if the hat switch is first released in the current cycle.
|
|
bool | IsHatSwitchDown (int axis, int direction) |
| Returns if the hat switch is down.
|
|
bool | WasHatSwitchDown (int axis, int direction) |
| Returns if the hat switch was down in the previous cycle.
|
|
double | GetRawAxisDelta (int axis) |
| Gets the change in axis value.
|
|
double | GetLastAxis (int axis) |
| Gets the value of the axis in the previous cycle.
|
|
int | GetNumButtons () |
| Gets the number of buttons on this joystick.
|
|
int | GetNumAxes () |
| Gets the number of axes on this joystick.
|
|
UINT32 | GetPort () |
| Gets the port that this joystick is on.
|
|
void | Log () |
| Logs data to the Logger.
|
|
|
template<typename T > |
void | LogToFile (T *field, std::string name) |
| Saves a variable to the Logger for logging.
|
|
template<typename T > |
void | LogToFile (T *field, int count, std::string name) |
| Saves a dynamically allocated array to the Logger for logging.
|
|
template<typename T > |
void | LogToFile (T value, std::string name) |
| Saves a value to the Logger for logging.
|
|
Implements a joystick with last state checking ability.
bool DebouncedJoystick::AxisInBounds |
( |
int |
axis | ) |
|
Checks if an axis is in bounds.
- Parameters
-
- Returns
- whether the axis is in bounds
bool DebouncedJoystick::ButtonInBounds |
( |
int |
button | ) |
|
Checks if a button is in bounds.
- Parameters
-
button | the button to check |
- Returns
- whether the button is in bounds
double DebouncedJoystick::GetLastAxis |
( |
int |
axis | ) |
|
Gets the value of the axis in the previous cycle.
- Parameters
-
- Returns
- the value of the axis in the previous cycle
int DebouncedJoystick::GetNumAxes |
( |
| ) |
|
Gets the number of axes on this joystick.
- Returns
- the number of axes
int DebouncedJoystick::GetNumButtons |
( |
| ) |
|
Gets the number of buttons on this joystick.
- Returns
- the number of buttons
UINT32 DebouncedJoystick::GetPort |
( |
| ) |
|
Gets the port that this joystick is on.
- Returns
- the port of the joystick
double DebouncedJoystick::GetRawAxisDelta |
( |
int |
axis | ) |
|
Gets the change in axis value.
- Parameters
-
- Returns
- the change in value of the axis
bool DebouncedJoystick::IsButtonDown |
( |
int |
button | ) |
|
Returns if the button is down.
- Parameters
-
button | the button to check |
- Returns
- whether the button is down
bool DebouncedJoystick::IsButtonJustPressed |
( |
int |
button | ) |
|
Returns whether a button is first pressed in the current cycle.
- Parameters
-
button | the button to check |
- Returns
- whether the button was just pressed
bool DebouncedJoystick::IsButtonJustReleased |
( |
int |
button | ) |
|
Returns whether a button is first released in the current cycle.
- Parameters
-
button | the button to check |
- Returns
- whether the button was just released
bool DebouncedJoystick::IsHatSwitchDown |
( |
int |
axis, |
|
|
int |
direction |
|
) |
| |
Returns if the hat switch is down.
- Parameters
-
axis | the axis of the switch to check |
direction | the direction of the switch to check |
- Returns
- whether the hat switch is down
bool DebouncedJoystick::IsHatSwitchJustPressed |
( |
int |
axis, |
|
|
int |
direction |
|
) |
| |
Returns if the hat switch is first pressed in the current cycle.
- Parameters
-
axis | the axis of the switch to check |
direction | the direction of the switch to check |
- Returns
- whether the hat switch was just pressed
bool DebouncedJoystick::IsHatSwitchJustReleased |
( |
int |
axis, |
|
|
int |
direction |
|
) |
| |
Returns if the hat switch is first released in the current cycle.
- Parameters
-
axis | the axis of the switch to check |
direction | the direction of the switch to check |
- Returns
- whether the hat switch was just released
bool DebouncedJoystick::WasButtonDown |
( |
int |
button | ) |
|
Returns if the button was down in the previous cycle.
- Parameters
-
button | the button to check |
- Returns
- whether the button was down in the previous cycle
bool DebouncedJoystick::WasHatSwitchDown |
( |
int |
axis, |
|
|
int |
direction |
|
) |
| |
Returns if the hat switch was down in the previous cycle.
- Parameters
-
axis | the axis of the switch to check |
direction | the direction of the switch to check |
- Returns
- whether the hat switch was down in the previous cycle
The documentation for this class was generated from the following files: