Class MultiAxisButton


  • public class MultiAxisButton
    extends edu.wpi.first.wpilibj2.command.button.Button
    A button based on a set of joystick axes. This can be used to emulate a button that is triggered by the movement of any specified axis.
    • Constructor Summary

      Constructors 
      Constructor Description
      MultiAxisButton​(@NotNull edu.wpi.first.wpilibj.GenericHID stick, double threshold)
      Constructs an MultiAxisButton.
      MultiAxisButton​(@NotNull edu.wpi.first.wpilibj.GenericHID stick, double threshold, int[] axes)
      Constructs an MultiAxisButton.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean get()  
      • Methods inherited from class edu.wpi.first.wpilibj2.command.button.Button

        cancelWhenPressed, toggleWhenPressed, toggleWhenPressed, whenHeld, whenHeld, whenPressed, whenPressed, whenPressed, whenReleased, whenReleased, whenReleased, whileHeld, whileHeld, whileHeld
      • Methods inherited from class edu.wpi.first.wpilibj2.command.button.Trigger

        and, cancelWhenActive, negate, or, toggleWhenActive, toggleWhenActive, whenActive, whenActive, whenActive, whenInactive, whenInactive, whenInactive, whileActiveContinuous, whileActiveContinuous, whileActiveContinuous, whileActiveOnce, whileActiveOnce
    • Constructor Detail

      • MultiAxisButton

        public MultiAxisButton​(@NotNull
                               @NotNull edu.wpi.first.wpilibj.GenericHID stick,
                               double threshold)
        Constructs an MultiAxisButton.
        Parameters:
        stick - The axes's joystick
        threshold - The threshold for the button to be triggered (if any axes are over the threshold)
        Throws:
        NullPointerException - If stick is null.
      • MultiAxisButton

        public MultiAxisButton​(@NotNull
                               @NotNull edu.wpi.first.wpilibj.GenericHID stick,
                               double threshold,
                               int[] axes)
        Constructs an MultiAxisButton.
        Parameters:
        stick - The axes's joystick
        axes - The axes to use as a button
        threshold - The threshold for the button to be triggered (if any specified axes are over the threshold)
        Throws:
        NullPointerException - If stick is null.
    • Method Detail

      • get

        public boolean get()
        Overrides:
        get in class edu.wpi.first.wpilibj2.command.button.Trigger