393 uint16_t m_leftRumble = 0;
394 uint16_t m_rightRumble = 0;
395 uint16_t m_leftTriggerRumble = 0;
396 uint16_t m_rightTriggerRumble = 0;
This class provides an easy way to link actions to active high logic signals.
Definition BooleanEvent.hpp:28
POVDirection
A controller POV direction.
Definition DriverStation.hpp:62
A declarative way to bind a set of actions to a loop and execute them when the loop is polled.
Definition EventLoop.hpp:15
DriverStation::TouchpadFinger GetTouchpadFinger(int touchpad, int finger) const
Get the touchpad finger data.
BooleanEvent POVRight(EventLoop *loop) const
Constructs a BooleanEvent instance based around the right direction of the default (index 0) POV on t...
BooleanEvent POVDownLeft(EventLoop *loop) const
Constructs a BooleanEvent instance based around the down left direction of the default (index 0) POV ...
RumbleType
Represents a rumble output on the Joystick.
Definition GenericHID.hpp:31
@ kLeftRumble
Left rumble motor.
Definition GenericHID.hpp:33
@ kRightTriggerRumble
Right trigger rumble motor.
Definition GenericHID.hpp:39
@ kLeftTriggerRumble
Left trigger rumble motor.
Definition GenericHID.hpp:37
@ kRightRumble
Right rumble motor.
Definition GenericHID.hpp:35
GenericHID::HIDType GetGamepadType() const
Get the type of the HID.
int GetAxesAvailable() const
Get the number of axes for the HID.
int GetPOVsAvailable() const
Get the number of POVs for the HID.
std::string GetName() const
Get the name of the HID.
int GetPort() const
Get the port number of the HID.
BooleanEvent POVDownRight(EventLoop *loop) const
Constructs a BooleanEvent instance based around the down right direction of the default (index 0) POV...
int GetButtonsMaximumIndex() const
BooleanEvent POV(DriverStation::POVDirection angle, EventLoop *loop) const
Constructs a BooleanEvent instance based around this angle of a POV on the HID.
BooleanEvent POV(int pov, DriverStation::POVDirection angle, EventLoop *loop) const
Constructs a BooleanEvent instance based around this angle of a POV on the HID.
uint64_t GetButtonsAvailable() const
Get the number of buttons for the HID.
void SetLeds(int r, int g, int b)
Set leds on the controller.
double GetRawAxis(int axis) const
Get the value of the axis.
int GetPOVsMaximumIndex() const
bool GetRawButton(int button) const
Get the button value (starting at button 1).
virtual ~GenericHID()=default
BooleanEvent AxisLessThan(int axis, double threshold, EventLoop *loop) const
Constructs an event instance that is true when the axis value is less than threshold.
bool IsConnected() const
Get if the HID is connected.
bool GetTouchpadFingerAvailable(int touchpad, int finger) const
Check if a touchpad finger is available.
void SetRumble(RumbleType type, double value)
Set the rumble output for the HID.
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 POVLeft(EventLoop *loop) const
Constructs a BooleanEvent instance based around the left direction of the default (index 0) POV on th...
bool GetRawButtonReleased(int button)
Whether the button was released since the last check.
BooleanEvent POVUpLeft(EventLoop *loop) const
Constructs a BooleanEvent instance based around the up left direction of the default (index 0) POV on...
BooleanEvent POVDown(EventLoop *loop) const
Constructs a BooleanEvent instance based around the down direction of the default (index 0) POV on th...
DriverStation::POVDirection GetPOV(int pov=0) const
Get the angle of a POV on the HID.
HIDType
USB HID interface type.
Definition GenericHID.hpp:63
@ kUnknown
Unknown.
Definition GenericHID.hpp:65
@ kStandard
Standard HID device.
Definition GenericHID.hpp:67
@ kXboxOne
Xbox One controller.
Definition GenericHID.hpp:71
@ kPS3
PS3 controller.
Definition GenericHID.hpp:73
@ kSwitchJoyconPair
Nintendo Switch Joycon controller pair.
Definition GenericHID.hpp:85
@ kPS5
PS5 controller.
Definition GenericHID.hpp:77
@ kSwitchPro
Nintendo Switch Pro controller.
Definition GenericHID.hpp:79
@ kPS4
PS4 controller.
Definition GenericHID.hpp:75
@ kSwitchJoyconLeft
Nintendo Switch Joycon Left controller.
Definition GenericHID.hpp:81
@ kXbox360
Xbox 360 controller.
Definition GenericHID.hpp:69
@ kSwitchJoyconRight
Nintendo Switch Joycon Right controller.
Definition GenericHID.hpp:83
SupportedOutputs
Represents the various outputs that a HID may support.
Definition GenericHID.hpp:45
@ kPlayerLed
Player LED support.
Definition GenericHID.hpp:53
@ kRumble
Rumble support.
Definition GenericHID.hpp:55
@ kMonoLed
Mono LED support.
Definition GenericHID.hpp:49
@ kRgbLed
RGB LED support.
Definition GenericHID.hpp:51
@ kTriggerRumble
Trigger rumble support.
Definition GenericHID.hpp:57
@ kNone
No outputs supported.
Definition GenericHID.hpp:47
GenericHID & operator=(GenericHID &&)=default
GenericHID(GenericHID &&)=default
BooleanEvent POVCenter(EventLoop *loop) const
Constructs a BooleanEvent instance based around the center (not pressed) of the default (index 0) POV...
GenericHID::SupportedOutputs GetSupportedOutputs() const
Get the supported outputs of the HID.
int GetAxesMaximumIndex() const
BooleanEvent POVUpRight(EventLoop *loop) const
Constructs a BooleanEvent instance based around the up right direction of the default (index 0) POV o...
BooleanEvent Button(int button, EventLoop *loop) const
Constructs an event instance around this button's digital signal.
BooleanEvent POVUp(EventLoop *loop) const
Constructs a BooleanEvent instance based around the up direction of the default (index 0) POV on the ...
bool GetRawButtonPressed(int button)
Whether the button was pressed since the last check.
Definition CvSource.hpp:15
Definition DriverStation.hpp:83