Class JoystickButton
- java.lang.Object
-
- edu.wpi.first.wpilibj2.command.button.Trigger
-
- edu.wpi.first.wpilibj2.command.button.Button
-
- edu.wpi.first.wpilibj2.command.button.JoystickButton
-
- All Implemented Interfaces:
BooleanSupplier
public class JoystickButton extends Button
AButton
that gets its state from aGenericHID
.
-
-
Constructor Summary
Constructors Constructor Description JoystickButton(GenericHID joystick, int buttonNumber)
Creates a joystick button for triggering commands.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
get()
Gets the value of the joystick button.-
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, debounce, debounce, getAsBoolean, negate, or, toggleWhenActive, toggleWhenActive, whenActive, whenActive, whenActive, whenInactive, whenInactive, whenInactive, whileActiveContinuous, whileActiveContinuous, whileActiveContinuous, whileActiveOnce, whileActiveOnce
-
-
-
-
Constructor Detail
-
JoystickButton
public JoystickButton(GenericHID joystick, int buttonNumber)
Creates a joystick button for triggering commands.- Parameters:
joystick
- The GenericHID object that has the button (e.g. Joystick, KinectStick, etc)buttonNumber
- The button number (seeGenericHID.getRawButton(int)
-
-