393 uint16_t m_leftRumble = 0;
394 uint16_t m_rightRumble = 0;
395 uint16_t m_leftTriggerRumble = 0;
396 uint16_t m_rightTriggerRumble = 0;
402 static_cast<int>(B));
This class provides an easy way to link actions to active high logic signals.
Definition BooleanEvent.hpp:28
A declarative way to bind a set of actions to a loop and execute them when the loop is polled.
Definition EventLoop.hpp:15
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 ...
BooleanEvent POV(int pov, POVDirection angle, EventLoop *loop) const
Constructs a BooleanEvent instance based around this angle of a POV on the HID.
RumbleType
Represents a rumble output on the Joystick.
Definition GenericHID.hpp:33
@ RIGHT_TRIGGER_RUMBLE
Right trigger rumble motor.
Definition GenericHID.hpp:41
@ RIGHT_RUMBLE
Right rumble motor.
Definition GenericHID.hpp:37
@ LEFT_RUMBLE
Left rumble motor.
Definition GenericHID.hpp:35
@ LEFT_TRIGGER_RUMBLE
Left trigger rumble motor.
Definition GenericHID.hpp:39
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
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...
SupportedOutputs GetSupportedOutputs() const
Get the supported outputs of the HID.
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 POV(POVDirection angle, EventLoop *loop) const
Constructs a BooleanEvent instance based around this angle of a POV on the HID.
BooleanEvent POVDown(EventLoop *loop) const
Constructs a BooleanEvent instance based around the down direction of the default (index 0) POV on th...
POVDirection GetPOV(int pov=0) const
Get the angle of a POV on the HID.
TouchpadFinger GetTouchpadFinger(int touchpad, int finger) const
Get the touchpad finger data.
HIDType
USB HID interface type.
Definition GenericHID.hpp:65
@ SWITCH_PRO
Nintendo Switch Pro controller.
Definition GenericHID.hpp:81
@ PS5
PS5 controller.
Definition GenericHID.hpp:79
@ UNKNOWN
Unknown.
Definition GenericHID.hpp:67
@ SWITCH_JOYCON_LEFT
Nintendo Switch Joycon Left controller.
Definition GenericHID.hpp:83
@ PS4
PS4 controller.
Definition GenericHID.hpp:77
@ STANDARD
Standard HID device.
Definition GenericHID.hpp:69
@ SWITCH_JOYCON_RIGHT
Nintendo Switch Joycon Right controller.
Definition GenericHID.hpp:85
@ XBOX_360
Xbox 360 controller.
Definition GenericHID.hpp:71
@ PS3
PS3 controller.
Definition GenericHID.hpp:75
@ SWITCH_JOYCON_PAIR
Nintendo Switch Joycon controller pair.
Definition GenericHID.hpp:87
@ XBOX_ONE
Xbox One controller.
Definition GenericHID.hpp:73
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...
SupportedOutputs
Represents the various outputs that a HID may support.
Definition GenericHID.hpp:47
@ TRIGGER_RUMBLE
Trigger rumble support.
Definition GenericHID.hpp:59
@ RGB_LED
RGB LED support.
Definition GenericHID.hpp:53
@ PLAYER_LED
Player LED support.
Definition GenericHID.hpp:55
@ RUMBLE
Rumble support.
Definition GenericHID.hpp:57
@ MONO_LED
Mono LED support.
Definition GenericHID.hpp:51
@ NONE
No outputs supported.
Definition GenericHID.hpp:49
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
GenericHID::SupportedOutputs operator|(GenericHID::SupportedOutputs A, GenericHID::SupportedOutputs B)
Definition GenericHID.hpp:399
POVDirection
A controller POV direction.
Definition POVDirection.hpp:18
GenericHID::SupportedOutputs & operator|=(GenericHID::SupportedOutputs &A, GenericHID::SupportedOutputs B)
Definition GenericHID.hpp:405
Touchpad finger data from a joystick.
Definition TouchpadFinger.hpp:12