mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-05 03:21:42 +00:00
[wpilib] Add BooleanEvent/Trigger factories on HID classes (#4247)
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user