LRT14  1.0
 All Classes Namespaces Functions Variables Enumerations Enumerator
DebouncedJoystick Class Reference

Implements a joystick with last state checking ability. More...

#include <DebouncedJoystick.h>

Inheritance diagram for DebouncedJoystick:
Collaboration diagram for DebouncedJoystick:

Public Member Functions

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.
 

Additional Inherited Members

- Protected Member Functions inherited from Loggable
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.
 

Detailed Description

Implements a joystick with last state checking ability.

Member Function Documentation

bool DebouncedJoystick::AxisInBounds ( int  axis)

Checks if an axis is in bounds.

Parameters
axisthe axis to check
Returns
whether the axis is in bounds

Here is the caller graph for this function:

bool DebouncedJoystick::ButtonInBounds ( int  button)

Checks if a button is in bounds.

Parameters
buttonthe button to check
Returns
whether the button is in bounds

Here is the caller graph for this function:

double DebouncedJoystick::GetLastAxis ( int  axis)

Gets the value of the axis in the previous cycle.

Parameters
axisthe axis to check
Returns
the value of the axis in the previous cycle

Here is the call graph for this function:

int DebouncedJoystick::GetNumAxes ( )

Gets the number of axes on this joystick.

Returns
the number of axes

Here is the caller graph for this function:

int DebouncedJoystick::GetNumButtons ( )

Gets the number of buttons on this joystick.

Returns
the number of buttons

Here is the caller graph for this function:

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
axisthe axis to check
Returns
the change in value of the axis

Here is the call graph for this function:

bool DebouncedJoystick::IsButtonDown ( int  button)

Returns if the button is down.

Parameters
buttonthe button to check
Returns
whether the button is down

Here is the call graph for this function:

Here is the caller graph for this function:

bool DebouncedJoystick::IsButtonJustPressed ( int  button)

Returns whether a button is first pressed in the current cycle.

Parameters
buttonthe button to check
Returns
whether the button was just pressed

Here is the call graph for this function:

Here is the caller graph for this function:

bool DebouncedJoystick::IsButtonJustReleased ( int  button)

Returns whether a button is first released in the current cycle.

Parameters
buttonthe button to check
Returns
whether the button was just released

Here is the call graph for this function:

bool DebouncedJoystick::IsHatSwitchDown ( int  axis,
int  direction 
)

Returns if the hat switch is down.

Parameters
axisthe axis of the switch to check
directionthe direction of the switch to check
Returns
whether the hat switch is down

Here is the call graph for this function:

Here is the caller graph for this function:

bool DebouncedJoystick::IsHatSwitchJustPressed ( int  axis,
int  direction 
)

Returns if the hat switch is first pressed in the current cycle.

Parameters
axisthe axis of the switch to check
directionthe direction of the switch to check
Returns
whether the hat switch was just pressed

Here is the call graph for this function:

bool DebouncedJoystick::IsHatSwitchJustReleased ( int  axis,
int  direction 
)

Returns if the hat switch is first released in the current cycle.

Parameters
axisthe axis of the switch to check
directionthe direction of the switch to check
Returns
whether the hat switch was just released

Here is the call graph for this function:

bool DebouncedJoystick::WasButtonDown ( int  button)

Returns if the button was down in the previous cycle.

Parameters
buttonthe button to check
Returns
whether the button was down in the previous cycle

Here is the call graph for this function:

bool DebouncedJoystick::WasHatSwitchDown ( int  axis,
int  direction 
)

Returns if the hat switch was down in the previous cycle.

Parameters
axisthe axis of the switch to check
directionthe direction of the switch to check
Returns
whether the hat switch was down in the previous cycle

Here is the call graph for this function:

Here is the caller graph for this function:


The documentation for this class was generated from the following files: