[wpilib] Add BooleanEvent/Trigger factories on HID classes (#4247)

This commit is contained in:
Starlight220
2022-06-14 08:48:16 +03:00
committed by GitHub
parent 9b1bf5c7f1
commit fd884581e4
24 changed files with 1717 additions and 1 deletions

View File

@@ -172,6 +172,15 @@ class Joystick : public GenericHID {
*/
bool GetTriggerReleased();
/**
* Constructs an event instance around the trigger button's digital signal.
*
* @param loop the event loop instance to attach the event to.
* @return an event instance representing the trigger button's digital signal
* attached to the given loop.
*/
BooleanEvent Trigger(EventLoop* loop) const;
/**
* Read the state of the top button on the joystick.
*
@@ -195,6 +204,15 @@ class Joystick : public GenericHID {
*/
bool GetTopReleased();
/**
* Constructs an event instance around the top button's digital signal.
*
* @param loop the event loop instance to attach the event to.
* @return an event instance representing the top button's digital signal
* attached to the given loop.
*/
BooleanEvent Top(EventLoop* loop) const;
/**
* Get the magnitude of the direction vector formed by the joystick's
* current position relative to its origin.