Package org.team1540.rooster.triggers
Class MultiAxisButton
- java.lang.Object
-
- edu.wpi.first.wpilibj2.command.button.Trigger
-
- edu.wpi.first.wpilibj2.command.button.Button
-
- org.team1540.rooster.triggers.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 anMultiAxisButton
.MultiAxisButton(@NotNull edu.wpi.first.wpilibj.GenericHID stick, double threshold, int[] axes)
Constructs anMultiAxisButton
.
-
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 anMultiAxisButton
.- Parameters:
stick
- The axes's joystickthreshold
- The threshold for the button to be triggered (if any axes are over the threshold)- Throws:
NullPointerException
- Ifstick
isnull
.
-
MultiAxisButton
public MultiAxisButton(@NotNull @NotNull edu.wpi.first.wpilibj.GenericHID stick, double threshold, int[] axes)
Constructs anMultiAxisButton
.- Parameters:
stick
- The axes's joystickaxes
- The axes to use as a buttonthreshold
- The threshold for the button to be triggered (if any specified axes are over the threshold)- Throws:
NullPointerException
- Ifstick
isnull
.
-
-