mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-27 02:01:42 +00:00
[commands] Add functions to HID classes to allow use of axes as BooleanEvents/Triggers (#4762)
This commit is contained in:
@@ -231,6 +231,31 @@ class GenericHID {
|
||||
*/
|
||||
BooleanEvent POVCenter(EventLoop* loop) const;
|
||||
|
||||
/**
|
||||
* Constructs an event instance that is true when the axis value is less than
|
||||
* threshold
|
||||
*
|
||||
* @param axis The axis to read, starting at 0.
|
||||
* @param threshold The value below which this trigger should return true.
|
||||
* @param loop the event loop instance to attach the event to.
|
||||
* @return an event instance that is true when the axis value is less than the
|
||||
* provided threshold.
|
||||
*/
|
||||
BooleanEvent AxisLessThan(int axis, double threshold, EventLoop* loop) const;
|
||||
|
||||
/**
|
||||
* Constructs an event instance that is true when the axis value is greater
|
||||
* than threshold
|
||||
*
|
||||
* @param axis The axis to read, starting at 0.
|
||||
* @param threshold The value above which this trigger should return true.
|
||||
* @param loop the event loop instance to attach the event to.
|
||||
* @return an event instance that is true when the axis value is greater than
|
||||
* the provided threshold.
|
||||
*/
|
||||
BooleanEvent AxisGreaterThan(int axis, double threshold,
|
||||
EventLoop* loop) const;
|
||||
|
||||
/**
|
||||
* Get the number of axes for the HID.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user