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

public class MomentaryButton extends Object implements Button
Active when held down and not active when up. Can be inverted.
  • Constructor Details

    • MomentaryButton

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

      public MomentaryButton(Button.BoolLambda button, boolean invert)
      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

    • 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