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

public class AxisAsButton extends Object implements Button
Makes a physical gamepad axis act as a button.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.firstinspires.ftc.teamcode.fy23.gamepad2.primitives.Button

    Button.BoolLambda
  • Constructor Summary

    Constructors
    Constructor
    Description
    AxisAsButton(Axis.DoubleLambda axis, double threshold)
    Pass in a lambda expression that returns the value of a Gamepad axis field: new LinearAxis( () -> gamepad.left_stick_x ); and also pass in an activation threshold along the range of the axis, after which the "button" is considered active
    AxisAsButton(Axis.DoubleLambda axis, double threshold, boolean invert)
    Same as the other constructor, but allows for inverting the reported value
  • 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

    • AxisAsButton

      public AxisAsButton(Axis.DoubleLambda axis, double threshold)
      Pass in a lambda expression that returns the value of a Gamepad axis field: new LinearAxis( () -> gamepad.left_stick_x ); and also pass in an activation threshold along the range of the axis, after which the "button" is considered active
    • AxisAsButton

      public AxisAsButton(Axis.DoubleLambda axis, double threshold, boolean invert)
      Same as the other constructor, but allows for inverting the reported value
  • 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