Class AxisAsButton
java.lang.Object
org.firstinspires.ftc.teamcode.fy23.gamepad2.primitives.buttons.AxisAsButton
- All Implemented Interfaces:
Button
Makes a physical gamepad axis act as a button.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.firstinspires.ftc.teamcode.fy23.gamepad2.primitives.Button
Button.BoolLambda
-
Constructor Summary
ConstructorDescriptionAxisAsButton
(Axis.DoubleLambda axis, double threshold) Pass in a lambda expression that returns the value of aGamepad
axis field: new LinearAxis( () -> gamepad.left_stick_x ); and also pass in an activation threshold along the range of the axis, after which the "button" is considered activeAxisAsButton
(Axis.DoubleLambda axis, double threshold, boolean invert) Same as the other constructor, but allows for inverting the reported value -
Method Summary
Modifier and TypeMethodDescriptionboolean
isActive()
When a button should be considered active depends on the implementation and its parameters.
-
Constructor Details
-
AxisAsButton
Pass in a lambda expression that returns the value of aGamepad
axis field: new LinearAxis( () -> gamepad.left_stick_x ); and also pass in an activation threshold along the range of the axis, after which the "button" is considered active -
AxisAsButton
Same as the other constructor, but allows for inverting the reported value
-
-
Method Details