Package org.team1540.rooster.triggers
Class DPadButton
- java.lang.Object
-
- edu.wpi.first.wpilibj2.command.button.Trigger
-
- edu.wpi.first.wpilibj2.command.button.Button
-
- org.team1540.rooster.triggers.DPadButton
-
public class DPadButton extends edu.wpi.first.wpilibj2.command.button.Button
Used to map a button from the D-Pad on a controller to a button so it can be used for triggering commands.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DPadButton.DPadAxis
Deprecated.UseDPadAxis
-
Constructor Summary
Constructors Constructor Description DPadButton(@NotNull edu.wpi.first.wpilibj.GenericHID stick, int pad, DPadAxis axis)
Constructs aDPadButton
.DPadButton(edu.wpi.first.wpilibj.GenericHID stick, int pad, DPadButton.DPadAxis axis)
-
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
-
DPadButton
@Deprecated public DPadButton(edu.wpi.first.wpilibj.GenericHID stick, int pad, DPadButton.DPadAxis axis)
Constructs aDPadButton
.- Parameters:
stick
- The joystick with the button.pad
- The ID of the d-pad.axis
- The axis of the button.
-
DPadButton
public DPadButton(@NotNull @NotNull edu.wpi.first.wpilibj.GenericHID stick, int pad, @NotNull DPadAxis axis)
Constructs aDPadButton
.- Parameters:
stick
- The joystick with the button.pad
- The ID of the d-pad.axis
- The axis of the button.- Throws:
NullPointerException
- Ifstick
oraxis
isnull
.IllegalArgumentException
- Ifpad
is negative.
-
-