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:
BooleanSupplier
Class to mock a joystick button from a hardware joystick axis.
-
Constructor Summary
ConstructorsConstructorDescriptionVirtualJoystickButton(edu.wpi.first.wpilibj.event.EventLoop pollingLoop, JoystickAxis axis, double minimumValue, double maximumValue, boolean inverse) Constructs a VirtualJoystickButton.VirtualJoystickButton(JoystickAxis axis, double minimumValue, double maximumValue, boolean inverse) Constructs a VirtualJoystickButton, using the default CommandScheduler polling. -
Method Summary
Methods inherited from class org.chsrobotics.lib.input.JoystickButton
getAsBoolean, invert, isInverted, isReal, toStringMethods inherited from class edu.wpi.first.wpilibj2.command.button.Trigger
and, cancelWhenActive, debounce, debounce, negate, onFalse, onTrue, or, toggleOnFalse, toggleOnTrue, toggleWhenActive, whenActive, whenActive, whenInactive, whenInactive, whileActiveContinuous, whileActiveContinuous, whileActiveOnce, whileFalse, whileTrue
-
Constructor Details
-
VirtualJoystickButton
public VirtualJoystickButton(edu.wpi.first.wpilibj.event.EventLoop pollingLoop, JoystickAxis axis, double minimumValue, double maximumValue, boolean inverse) Constructs a VirtualJoystickButton.- Parameters:
pollingLoop- An EventLoop to poll for the resulting button'sTriggerfunctionality.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.
-
VirtualJoystickButton
public VirtualJoystickButton(JoystickAxis axis, double minimumValue, double maximumValue, boolean inverse) Constructs a VirtualJoystickButton, using the default CommandScheduler polling.- 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.
-