Class ToggleButton
java.lang.Object
org.firstinspires.ftc.teamcode.fy23.gamepad2.primitives.buttons.ToggleButton
- All Implemented Interfaces:
Button
Toggles state on each press.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.firstinspires.ftc.teamcode.fy23.gamepad2.primitives.Button
Button.BoolLambda
-
Constructor Summary
ConstructorDescriptionToggleButton
(Button.BoolLambda button) Pass in a lambda expression that returns the value of aGamepad
button field: new ToggleButton( () -> gamepad.x );ToggleButton
(Button.BoolLambda button, boolean initialState) Same as the other constructor, but allows for setting the initial state. -
Method Summary
Modifier and TypeMethodDescriptionboolean
isActive()
When a button should be considered active depends on the implementation and its parameters.
-
Constructor Details
-
ToggleButton
Pass in a lambda expression that returns the value of aGamepad
button field: new ToggleButton( () -> gamepad.x ); -
ToggleButton
Same as the other constructor, but allows for setting the initial state.
-
-
Method Details