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

public class VirtualJoystickButton extends JoystickButton
Class to mock a joystick button from a hardware joystick axis.
  • Constructor Summary

    Constructors
    Constructor
    Description
    VirtualJoystickButton(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, toString

    Methods 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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • 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's Trigger functionality.
      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.