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

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

    Constructors
    Constructor
    Description
    Pass in a lambda expression that returns the value of a Gamepad 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 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

    • TriggerButton

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

      public TriggerButton(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