This class provides an easy way to link actions to inputs.
Definition: BooleanEvent.h:31
The loop polling BooleanEvent objects and executing the actions bound to them.
Definition: EventLoop.h:15
Handle input from standard HID devices connected to the Driver Station.
Definition: GenericHID.h:24
double GetRawAxis(int axis) const
Get the value of the axis.
BooleanEvent POVUpLeft(EventLoop *loop) const
Constructs a BooleanEvent instance based around the 315 degree angle (left up) of the default (index ...
GenericHID::HIDType GetType() const
Get the type of the HID.
BooleanEvent POVCenter(EventLoop *loop) const
Constructs a BooleanEvent instance based around the center (not pressed) of the default (index 0) POV...
BooleanEvent POVDown(EventLoop *loop) const
Constructs a BooleanEvent instance based around the 180 degree angle (down) of the default (index 0) ...
virtual ~GenericHID()=default
BooleanEvent POVUp(EventLoop *loop) const
Constructs a BooleanEvent instance based around the 0 degree angle (up) of the default (index 0) POV ...
BooleanEvent POV(int pov, int angle, EventLoop *loop) const
Constructs a BooleanEvent instance based around this angle of a POV on the HID.
BooleanEvent POVRight(EventLoop *loop) const
Constructs a BooleanEvent instance based around the 90 degree angle (right) of the default (index 0) ...
int GetAxisType(int axis) const
Get the axis type of a joystick axis.
bool GetRawButton(int button) const
Get the button value (starting at button 1).
BooleanEvent POVUpRight(EventLoop *loop) const
Constructs a BooleanEvent instance based around the 45 degree angle (right up) of the default (index ...
BooleanEvent AxisGreaterThan(int axis, double threshold, EventLoop *loop) const
Constructs an event instance that is true when the axis value is greater than threshold.
BooleanEvent AxisLessThan(int axis, double threshold, EventLoop *loop) const
Constructs an event instance that is true when the axis value is less than threshold.
RumbleType
Definition: GenericHID.h:26
@ kBothRumble
Definition: GenericHID.h:26
@ kLeftRumble
Definition: GenericHID.h:26
@ kRightRumble
Definition: GenericHID.h:26
int GetPOVCount() const
Get the number of POVs for the HID.
int GetPort() const
Get the port number of the HID.
void SetOutputs(int value)
Set all output values for the HID.
BooleanEvent Button(int button, EventLoop *loop) const
Constructs an event instance around this button's digital signal.
bool IsConnected() const
Get if the HID is connected.
GenericHID(GenericHID &&)=default
GenericHID & operator=(GenericHID &&)=default
void SetOutput(int outputNumber, bool value)
Set a single HID output value for the HID.
BooleanEvent POVLeft(EventLoop *loop) const
Constructs a BooleanEvent instance based around the 270 degree angle (left) of the default (index 0) ...
HIDType
Definition: GenericHID.h:28
@ kXInputArcadeStick
Definition: GenericHID.h:33
@ kXInputDrumKit
Definition: GenericHID.h:38
@ kHIDJoystick
Definition: GenericHID.h:41
@ kHIDGamepad
Definition: GenericHID.h:42
@ kXInputWheel
Definition: GenericHID.h:32
@ kHID1stPerson
Definition: GenericHID.h:45
@ kXInputGuitar
Definition: GenericHID.h:36
@ kXInputFlightStick
Definition: GenericHID.h:34
@ kXInputArcadePad
Definition: GenericHID.h:40
@ kUnknown
Definition: GenericHID.h:29
@ kHIDFlight
Definition: GenericHID.h:44
@ kXInputGuitar3
Definition: GenericHID.h:39
@ kXInputGuitar2
Definition: GenericHID.h:37
@ kXInputDancePad
Definition: GenericHID.h:35
@ kHIDDriving
Definition: GenericHID.h:43
@ kXInputGamepad
Definition: GenericHID.h:31
@ kXInputUnknown
Definition: GenericHID.h:30
int GetButtonCount() const
Get the number of buttons for the HID.
int GetPOV(int pov=0) const
Get the angle in degrees of a POV on the HID.
bool GetRawButtonPressed(int button)
Whether the button was pressed since the last check.
std::string GetName() const
Get the name of the HID.
BooleanEvent POV(int angle, EventLoop *loop) const
Constructs a BooleanEvent instance based around this angle of a POV on the HID.
BooleanEvent POVDownRight(EventLoop *loop) const
Constructs a BooleanEvent instance based around the 135 degree angle (right down) of the default (ind...
void SetRumble(RumbleType type, double value)
Set the rumble output for the HID.
int GetAxisCount() const
Get the number of axes for the HID.
bool GetRawButtonReleased(int button)
Whether the button was released since the last check.
BooleanEvent POVDownLeft(EventLoop *loop) const
Constructs a BooleanEvent instance based around the 225 degree angle (down left) of the default (inde...
type
Definition: core.h:575
::uint16_t uint16_t
Definition: Meta.h:54
Definition: AprilTagFieldLayout.h:22