Class TriggerButton
java.lang.Object
org.firstinspires.ftc.teamcode.fy23.gamepad2.primitives.buttons.TriggerButton
- All Implemented Interfaces:
Button
Only active on the initial press. Can trigger when button goes up or down.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.firstinspires.ftc.teamcode.fy23.gamepad2.primitives.Button
Button.BoolLambda
-
Constructor Summary
ConstructorDescriptionTriggerButton
(Button.BoolLambda button) Pass in a lambda expression that returns the value of aGamepad
button field: new TriggerButton( () -> gamepad.x );TriggerButton
(Button.BoolLambda button, boolean invert) Same as the other constructor, but allows for inverting the active state. -
Method Summary
Modifier and TypeMethodDescriptionboolean
isActive()
When a button should be considered active depends on the implementation and its parameters.
-
Constructor Details
-
TriggerButton
Pass in a lambda expression that returns the value of aGamepad
button field: new TriggerButton( () -> gamepad.x ); -
TriggerButton
Same as the other constructor, but allows for inverting the active state. If invert is set to true, then isActive() returns true when the button is up and false when the button is down.
-
-
Method Details