Class MomentaryButton
java.lang.Object
org.firstinspires.ftc.teamcode.fy23.gamepad2.primitives.buttons.MomentaryButton
- All Implemented Interfaces:
Button
Active when held down and not active when up. Can be inverted.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.firstinspires.ftc.teamcode.fy23.gamepad2.primitives.Button
Button.BoolLambda
-
Constructor Summary
ConstructorDescriptionMomentaryButton
(Button.BoolLambda button) Pass in a lambda expression that returns the value of aGamepad
button field: new MomentaryButton( () -> gamepad.x );MomentaryButton
(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
-
MomentaryButton
Pass in a lambda expression that returns the value of aGamepad
button field: new MomentaryButton( () -> gamepad.x ); -
MomentaryButton
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