java.lang.Object
org.firstinspires.ftc.teamcode.fy23.gamepad2.primitives.buttons.ToggleButton
All Implemented Interfaces:
Button

public class ToggleButton extends Object implements 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

    Constructors
    Constructor
    Description
    Pass in a lambda expression that returns the value of a Gamepad 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 Type
    Method
    Description
    boolean
    When a button should be considered active depends on the implementation and its parameters.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ToggleButton

      public ToggleButton(Button.BoolLambda button)
      Pass in a lambda expression that returns the value of a Gamepad button field: new ToggleButton( () -> gamepad.x );
    • ToggleButton

      public ToggleButton(Button.BoolLambda button, boolean initialState)
      Same as the other constructor, but allows for setting the initial state.
  • Method Details

    • isActive

      public boolean isActive()
      Description copied from interface: Button
      When a button should be considered active depends on the implementation and its parameters.
      Specified by:
      isActive in interface Button