|
| Joystick (int port) |
| Construct an instance of a joystick. More...
|
|
| ~Joystick () override=default |
|
| Joystick (Joystick &&)=default |
|
Joystick & | operator= (Joystick &&)=default |
|
void | SetXChannel (int channel) |
| Set the channel associated with the X axis. More...
|
|
void | SetYChannel (int channel) |
| Set the channel associated with the Y axis. More...
|
|
void | SetZChannel (int channel) |
| Set the channel associated with the Z axis. More...
|
|
void | SetTwistChannel (int channel) |
| Set the channel associated with the twist axis. More...
|
|
void | SetThrottleChannel (int channel) |
| Set the channel associated with the throttle axis. More...
|
|
int | GetXChannel () const |
| Get the channel currently associated with the X axis. More...
|
|
int | GetYChannel () const |
| Get the channel currently associated with the Y axis. More...
|
|
int | GetZChannel () const |
| Get the channel currently associated with the Z axis. More...
|
|
int | GetTwistChannel () const |
| Get the channel currently associated with the twist axis. More...
|
|
int | GetThrottleChannel () const |
| Get the channel currently associated with the throttle axis. More...
|
|
double | GetX () const |
| Get the X value of the current joystick. More...
|
|
double | GetY () const |
| Get the Y value of the current joystick. More...
|
|
double | GetZ () const |
| Get the Z value of the current joystick. More...
|
|
double | GetTwist () const |
| Get the twist value of the current joystick. More...
|
|
double | GetThrottle () const |
| Get the throttle value of the current joystick. More...
|
|
bool | GetTrigger () const |
| Read the state of the trigger on the joystick. More...
|
|
bool | GetTriggerPressed () |
| Whether the trigger was pressed since the last check. More...
|
|
bool | GetTriggerReleased () |
| Whether the trigger was released since the last check. More...
|
|
BooleanEvent | Trigger (EventLoop *loop) const |
| Constructs an event instance around the trigger button's digital signal. More...
|
|
bool | GetTop () const |
| Read the state of the top button on the joystick. More...
|
|
bool | GetTopPressed () |
| Whether the top button was pressed since the last check. More...
|
|
bool | GetTopReleased () |
| Whether the top button was released since the last check. More...
|
|
BooleanEvent | Top (EventLoop *loop) const |
| Constructs an event instance around the top button's digital signal. More...
|
|
double | GetMagnitude () const |
| Get the magnitude of the direction vector formed by the joystick's current position relative to its origin. More...
|
|
double | GetDirectionRadians () const |
| Get the direction of the vector formed by the joystick and its origin in radians. More...
|
|
double | GetDirectionDegrees () const |
| Get the direction of the vector formed by the joystick and its origin in degrees. More...
|
|
| GenericHID (int port) |
|
virtual | ~GenericHID ()=default |
|
| GenericHID (GenericHID &&)=default |
|
GenericHID & | operator= (GenericHID &&)=default |
|
bool | GetRawButton (int button) const |
| Get the button value (starting at button 1). More...
|
|
bool | GetRawButtonPressed (int button) |
| Whether the button was pressed since the last check. More...
|
|
bool | GetRawButtonReleased (int button) |
| Whether the button was released since the last check. More...
|
|
BooleanEvent | Button (int button, EventLoop *loop) const |
| Constructs an event instance around this button's digital signal. More...
|
|
double | GetRawAxis (int axis) const |
| Get the value of the axis. More...
|
|
int | GetPOV (int pov=0) const |
| Get the angle in degrees of a POV on the HID. More...
|
|
BooleanEvent | POV (int angle, EventLoop *loop) const |
| Constructs a BooleanEvent instance based around this angle of a POV on the HID. More...
|
|
BooleanEvent | POV (int pov, int angle, EventLoop *loop) const |
| Constructs a BooleanEvent instance based around this angle of a POV on the HID. More...
|
|
BooleanEvent | POVUp (EventLoop *loop) const |
| Constructs a BooleanEvent instance based around the 0 degree angle (up) of the default (index 0) POV on the HID. More...
|
|
BooleanEvent | POVUpRight (EventLoop *loop) const |
| Constructs a BooleanEvent instance based around the 45 degree angle (right up) of the default (index 0) POV on the HID. More...
|
|
BooleanEvent | POVRight (EventLoop *loop) const |
| Constructs a BooleanEvent instance based around the 90 degree angle (right) of the default (index 0) POV on the HID. More...
|
|
BooleanEvent | POVDownRight (EventLoop *loop) const |
| Constructs a BooleanEvent instance based around the 135 degree angle (right down) of the default (index 0) POV on the HID. More...
|
|
BooleanEvent | POVDown (EventLoop *loop) const |
| Constructs a BooleanEvent instance based around the 180 degree angle (down) of the default (index 0) POV on the HID. More...
|
|
BooleanEvent | POVDownLeft (EventLoop *loop) const |
| Constructs a BooleanEvent instance based around the 225 degree angle (down left) of the default (index 0) POV on the HID. More...
|
|
BooleanEvent | POVLeft (EventLoop *loop) const |
| Constructs a BooleanEvent instance based around the 270 degree angle (left) of the default (index 0) POV on the HID. More...
|
|
BooleanEvent | POVUpLeft (EventLoop *loop) const |
| Constructs a BooleanEvent instance based around the 315 degree angle (left up) of the default (index 0) POV on the HID. More...
|
|
BooleanEvent | POVCenter (EventLoop *loop) const |
| Constructs a BooleanEvent instance based around the center (not pressed) of the default (index 0) POV on the HID. More...
|
|
BooleanEvent | AxisLessThan (int axis, double threshold, EventLoop *loop) const |
| Constructs an event instance that is true when the axis value is less than threshold. More...
|
|
BooleanEvent | AxisGreaterThan (int axis, double threshold, EventLoop *loop) const |
| Constructs an event instance that is true when the axis value is greater than threshold. More...
|
|
int | GetAxisCount () const |
| Get the number of axes for the HID. More...
|
|
int | GetPOVCount () const |
| Get the number of POVs for the HID. More...
|
|
int | GetButtonCount () const |
| Get the number of buttons for the HID. More...
|
|
bool | IsConnected () const |
| Get if the HID is connected. More...
|
|
GenericHID::HIDType | GetType () const |
| Get the type of the HID. More...
|
|
std::string | GetName () const |
| Get the name of the HID. More...
|
|
int | GetAxisType (int axis) const |
| Get the axis type of a joystick axis. More...
|
|
int | GetPort () const |
| Get the port number of the HID. More...
|
|
void | SetOutput (int outputNumber, bool value) |
| Set a single HID output value for the HID. More...
|
|
void | SetOutputs (int value) |
| Set all output values for the HID. More...
|
|
void | SetRumble (RumbleType type, double value) |
| Set the rumble output for the HID. More...
|
|
Handle input from standard Joysticks connected to the Driver Station.
This class handles standard input that comes from the Driver Station. Each time a value is requested the most recent value is returned. There is a single class instance for each joystick and the mapping of ports to hardware buttons depends on the code in the Driver Station.