Package org.chsrobotics.lib.input
Class VirtualJoystickButton
- java.lang.Object
-
- edu.wpi.first.wpilibj2.command.button.Trigger
-
- org.chsrobotics.lib.input.JoystickButton
-
- org.chsrobotics.lib.input.VirtualJoystickButton
-
- All Implemented Interfaces:
java.util.function.BooleanSupplier
public class VirtualJoystickButton extends JoystickButton
Class to mock a joystick button from a hardware joystick axis.
-
-
Constructor Summary
Constructors Constructor Description VirtualJoystickButton(JoystickAxis axis, double minimumValue, double maximumValue, boolean inverse)Constructs a VirtualJoystickButton.
-
Method Summary
-
Methods inherited from class org.chsrobotics.lib.input.JoystickButton
get, invert, isInverted, isReal, toString
-
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
-
VirtualJoystickButton
public VirtualJoystickButton(JoystickAxis axis, double minimumValue, double maximumValue, boolean inverse)
Constructs a VirtualJoystickButton.- Parameters:
axis- The JoystickAxis to use as an input.minimumValue- The minimum value in [-1,1] (inclusive) the JoystickAxis can have for this to be considered pressed.maximumValue- The maximum value in [-1,1] (inclusive) the JoystickAxis can have for this to be considered pressed.inverse- If true, the button will be pressed *except* if it is between the minimum and maximum values.
-
-