Class CommandGamepad

java.lang.Object
org.wpilib.command3.button.CommandGamepad

public class CommandGamepad extends Object
A version of Gamepad with Trigger factories for command-based.
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    CommandGamepad(int port)
    Construct an instance of a controller.
    CommandGamepad(Scheduler scheduler, int port)
    Construct an instance of a controller.
    CommandGamepad(Scheduler scheduler, Gamepad gamepad)
    Construct an instance of a controller.
    Construct an instance of a controller.
  • Method Summary

    Modifier and Type
    Method
    Description
    Constructs a Trigger instance around the Back button's digital signal.
    Constructs a Trigger instance around the Back button's digital signal.
    button(int button)
    Constructs an event instance around this button's digital signal.
    button(int button, EventLoop loop)
    Constructs an event instance around this button's digital signal.
    Constructs a Trigger instance around the D-pad down button's digital signal.
    Constructs a Trigger instance around the D-pad down button's digital signal.
    Constructs a Trigger instance around the D-pad left button's digital signal.
    Constructs a Trigger instance around the D-pad left button's digital signal.
    Constructs a Trigger instance around the D-pad right button's digital signal.
    Constructs a Trigger instance around the D-pad right button's digital signal.
    Constructs a Trigger instance around the D-pad up button's digital signal.
    Constructs a Trigger instance around the D-pad up button's digital signal.
    Constructs a Trigger instance around the Face Down button's digital signal.
    Constructs a Trigger instance around the Face Down button's digital signal.
    Constructs a Trigger instance around the Face Left button's digital signal.
    Constructs a Trigger instance around the Face Left button's digital signal.
    Constructs a Trigger instance around the Face Right button's digital signal.
    Constructs a Trigger instance around the Face Right button's digital signal.
    Constructs a Trigger instance around the Face Up button's digital signal.
    Constructs a Trigger instance around the Face Up button's digital signal.
    Get the underlying Gamepad object.
    Get the underlying CommandGenericHID object.
    double
    Get the left trigger value of the controller.
    double
    Get the X axis value of left side of the controller.
    double
    Get the Y axis value of left side of the controller.
    double
    Get the right trigger value of the controller.
    double
    Get the X axis value of right side of the controller.
    double
    Get the Y axis value of right side of the controller.
    Constructs a Trigger instance around the Guide button's digital signal.
    Constructs a Trigger instance around the Guide button's digital signal.
    Constructs a Trigger instance around the right bumper button's digital signal.
    Constructs a Trigger instance around the right bumper button's digital signal.
    Constructs a Trigger instance around the Left Paddle 1 button's digital signal.
    Constructs a Trigger instance around the Left Paddle 1 button's digital signal.
    Constructs a Trigger instance around the Left Paddle 2 button's digital signal.
    Constructs a Trigger instance around the Left Paddle 2 button's digital signal.
    Constructs a Trigger instance around the left stick button's digital signal.
    Constructs a Trigger instance around the left stick button's digital signal.
    Constructs a Trigger instance around the axis value of the left trigger.
    leftTrigger(double threshold)
    Constructs a Trigger instance around the axis value of the left trigger.
    leftTrigger(double threshold, EventLoop loop)
    Constructs a Trigger instance around the axis value of the left trigger.
    Constructs a Trigger instance around the Miscellaneous 1 button's digital signal.
    Constructs a Trigger instance around the Miscellaneous 1 button's digital signal.
    Constructs a Trigger instance around the Miscellaneous 2 button's digital signal.
    Constructs a Trigger instance around the Miscellaneous 2 button's digital signal.
    Constructs a Trigger instance around the Miscellaneous 3 button's digital signal.
    Constructs a Trigger instance around the Miscellaneous 3 button's digital signal.
    Constructs a Trigger instance around the Miscellaneous 4 button's digital signal.
    Constructs a Trigger instance around the Miscellaneous 4 button's digital signal.
    Constructs a Trigger instance around the Miscellaneous 5 button's digital signal.
    Constructs a Trigger instance around the Miscellaneous 5 button's digital signal.
    Constructs a Trigger instance around the Miscellaneous 6 button's digital signal.
    Constructs a Trigger instance around the Miscellaneous 6 button's digital signal.
    Constructs a Trigger instance around the right bumper button's digital signal.
    Constructs a Trigger instance around the right bumper button's digital signal.
    Constructs a Trigger instance around the Right Paddle 1 button's digital signal.
    Constructs a Trigger instance around the Right Paddle 1 button's digital signal.
    Constructs a Trigger instance around the Right Paddle 2 button's digital signal.
    Constructs a Trigger instance around the Right Paddle 2 button's digital signal.
    Constructs a Trigger instance around the right stick button's digital signal.
    Constructs a Trigger instance around the right stick button's digital signal.
    Constructs a Trigger instance around the axis value of the right trigger.
    rightTrigger(double threshold)
    Constructs a Trigger instance around the axis value of the right trigger.
    rightTrigger(double threshold, EventLoop loop)
    Constructs a Trigger instance around the axis value of the right trigger.
    Constructs a Trigger instance around the Start button's digital signal.
    Constructs a Trigger instance around the Start button's digital signal.
    Constructs a Trigger instance around the Touchpad button's digital signal.
    Constructs a Trigger instance around the Touchpad button's digital signal.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CommandGamepad

      public CommandGamepad(int port)
      Construct an instance of a controller.
      Parameters:
      port - The port index on the Driver Station that the controller is plugged into.
    • CommandGamepad

      public CommandGamepad(Gamepad gamepad)
      Construct an instance of a controller. Commands bound to buttons on the controller will be scheduled on the default scheduler using its default event loop.
      Parameters:
      gamepad - The Gamepad object to use for this controller.
    • CommandGamepad

      public CommandGamepad(Scheduler scheduler, int port)
      Construct an instance of a controller.
      Parameters:
      scheduler - The scheduler that should execute the triggered commands.
      port - The port index on the Driver Station that the controller is plugged into.
    • CommandGamepad

      public CommandGamepad(Scheduler scheduler, Gamepad gamepad)
      Construct an instance of a controller. Commands bound to buttons on the controller will be scheduled on the given scheduler using its default event loop.
      Parameters:
      scheduler - The scheduler that should execute the triggered commands.
      gamepad - The Gamepad object to use for this controller.
  • Method Details

    • getHID

      public CommandGenericHID getHID()
      Get the underlying CommandGenericHID object.
      Returns:
      the wrapped CommandGenericHID object
    • getGamepad

      public Gamepad getGamepad()
      Get the underlying Gamepad object.
      Returns:
      the wrapped Gamepad object
    • button

      public Trigger button(int button)
      Constructs an event instance around this button's digital signal.
      Parameters:
      button - the button index
      Returns:
      an event instance representing the button's digital signal attached to the default scheduler button loop.
      See Also:
    • button

      public Trigger button(int button, EventLoop loop)
      Constructs an event instance around this button's digital signal.
      Parameters:
      button - the button index
      loop - the event loop instance to attach the event to.
      Returns:
      an event instance representing the button's digital signal attached to the given loop.
    • faceDown

      public Trigger faceDown()
      Constructs a Trigger instance around the Face Down button's digital signal.
      Returns:
      a Trigger instance representing the Face Down button's digital signal attached to the default scheduler event loop on the scheduler passed to the controller's constructor, or the default scheduler if a scheduler was not explicitly provided.
      See Also:
    • faceDown

      public Trigger faceDown(EventLoop loop)
      Constructs a Trigger instance around the Face Down button's digital signal.
      Parameters:
      loop - the event loop instance to attach the event to.
      Returns:
      a Trigger instance representing the Face Down button's digital signal attached to the given loop.
    • faceRight

      public Trigger faceRight()
      Constructs a Trigger instance around the Face Right button's digital signal.
      Returns:
      a Trigger instance representing the Face Right button's digital signal attached to the default scheduler event loop on the scheduler passed to the controller's constructor, or the default scheduler if a scheduler was not explicitly provided.
      See Also:
    • faceRight

      public Trigger faceRight(EventLoop loop)
      Constructs a Trigger instance around the Face Right button's digital signal.
      Parameters:
      loop - the event loop instance to attach the event to.
      Returns:
      a Trigger instance representing the Face Right button's digital signal attached to the given loop.
    • faceLeft

      public Trigger faceLeft()
      Constructs a Trigger instance around the Face Left button's digital signal.
      Returns:
      a Trigger instance representing the Face Left button's digital signal attached to the default scheduler event loop on the scheduler passed to the controller's constructor, or the default scheduler if a scheduler was not explicitly provided.
      See Also:
    • faceLeft

      public Trigger faceLeft(EventLoop loop)
      Constructs a Trigger instance around the Face Left button's digital signal.
      Parameters:
      loop - the event loop instance to attach the event to.
      Returns:
      a Trigger instance representing the Face Left button's digital signal attached to the given loop.
    • faceUp

      public Trigger faceUp()
      Constructs a Trigger instance around the Face Up button's digital signal.
      Returns:
      a Trigger instance representing the Face Up button's digital signal attached to the default scheduler event loop on the scheduler passed to the controller's constructor, or the default scheduler if a scheduler was not explicitly provided.
      See Also:
    • faceUp

      public Trigger faceUp(EventLoop loop)
      Constructs a Trigger instance around the Face Up button's digital signal.
      Parameters:
      loop - the event loop instance to attach the event to.
      Returns:
      a Trigger instance representing the Face Up button's digital signal attached to the given loop.
    • back

      public Trigger back()
      Constructs a Trigger instance around the Back button's digital signal.
      Returns:
      a Trigger instance representing the Back button's digital signal attached to the default scheduler event loop on the scheduler passed to the controller's constructor, or the default scheduler if a scheduler was not explicitly provided.
      See Also:
    • back

      public Trigger back(EventLoop loop)
      Constructs a Trigger instance around the Back button's digital signal.
      Parameters:
      loop - the event loop instance to attach the event to.
      Returns:
      a Trigger instance representing the Back button's digital signal attached to the given loop.
    • guide

      public Trigger guide()
      Constructs a Trigger instance around the Guide button's digital signal.
      Returns:
      a Trigger instance representing the Guide button's digital signal attached to the default scheduler event loop on the scheduler passed to the controller's constructor, or the default scheduler if a scheduler was not explicitly provided.
      See Also:
    • guide

      public Trigger guide(EventLoop loop)
      Constructs a Trigger instance around the Guide button's digital signal.
      Parameters:
      loop - the event loop instance to attach the event to.
      Returns:
      a Trigger instance representing the Guide button's digital signal attached to the given loop.
    • start

      public Trigger start()
      Constructs a Trigger instance around the Start button's digital signal.
      Returns:
      a Trigger instance representing the Start button's digital signal attached to the default scheduler event loop on the scheduler passed to the controller's constructor, or the default scheduler if a scheduler was not explicitly provided.
      See Also:
    • start

      public Trigger start(EventLoop loop)
      Constructs a Trigger instance around the Start button's digital signal.
      Parameters:
      loop - the event loop instance to attach the event to.
      Returns:
      a Trigger instance representing the Start button's digital signal attached to the given loop.
    • leftStick

      public Trigger leftStick()
      Constructs a Trigger instance around the left stick button's digital signal.
      Returns:
      a Trigger instance representing the left stick button's digital signal attached to the default scheduler event loop on the scheduler passed to the controller's constructor, or the default scheduler if a scheduler was not explicitly provided.
      See Also:
    • leftStick

      public Trigger leftStick(EventLoop loop)
      Constructs a Trigger instance around the left stick button's digital signal.
      Parameters:
      loop - the event loop instance to attach the event to.
      Returns:
      a Trigger instance representing the left stick button's digital signal attached to the given loop.
    • rightStick

      public Trigger rightStick()
      Constructs a Trigger instance around the right stick button's digital signal.
      Returns:
      a Trigger instance representing the right stick button's digital signal attached to the default scheduler event loop on the scheduler passed to the controller's constructor, or the default scheduler if a scheduler was not explicitly provided.
      See Also:
    • rightStick

      public Trigger rightStick(EventLoop loop)
      Constructs a Trigger instance around the right stick button's digital signal.
      Parameters:
      loop - the event loop instance to attach the event to.
      Returns:
      a Trigger instance representing the right stick button's digital signal attached to the given loop.
    • leftBumper

      public Trigger leftBumper()
      Constructs a Trigger instance around the right bumper button's digital signal.
      Returns:
      a Trigger instance representing the right bumper button's digital signal attached to the default scheduler event loop on the scheduler passed to the controller's constructor, or the default scheduler if a scheduler was not explicitly provided.
      See Also:
    • leftBumper

      public Trigger leftBumper(EventLoop loop)
      Constructs a Trigger instance around the right bumper button's digital signal.
      Parameters:
      loop - the event loop instance to attach the event to.
      Returns:
      a Trigger instance representing the right bumper button's digital signal attached to the given loop.
    • rightBumper

      public Trigger rightBumper()
      Constructs a Trigger instance around the right bumper button's digital signal.
      Returns:
      a Trigger instance representing the right bumper button's digital signal attached to the default scheduler event loop on the scheduler passed to the controller's constructor, or the default scheduler if a scheduler was not explicitly provided.
      See Also:
    • rightBumper

      public Trigger rightBumper(EventLoop loop)
      Constructs a Trigger instance around the right bumper button's digital signal.
      Parameters:
      loop - the event loop instance to attach the event to.
      Returns:
      a Trigger instance representing the right bumper button's digital signal attached to the given loop.
    • dpadUp

      public Trigger dpadUp()
      Constructs a Trigger instance around the D-pad up button's digital signal.
      Returns:
      a Trigger instance representing the D-pad up button's digital signal attached to the default scheduler event loop on the scheduler passed to the controller's constructor, or the default scheduler if a scheduler was not explicitly provided.
      See Also:
    • dpadUp

      public Trigger dpadUp(EventLoop loop)
      Constructs a Trigger instance around the D-pad up button's digital signal.
      Parameters:
      loop - the event loop instance to attach the event to.
      Returns:
      a Trigger instance representing the D-pad up button's digital signal attached to the given loop.
    • dpadDown

      public Trigger dpadDown()
      Constructs a Trigger instance around the D-pad down button's digital signal.
      Returns:
      a Trigger instance representing the D-pad down button's digital signal attached to the default scheduler event loop on the scheduler passed to the controller's constructor, or the default scheduler if a scheduler was not explicitly provided.
      See Also:
    • dpadDown

      public Trigger dpadDown(EventLoop loop)
      Constructs a Trigger instance around the D-pad down button's digital signal.
      Parameters:
      loop - the event loop instance to attach the event to.
      Returns:
      a Trigger instance representing the D-pad down button's digital signal attached to the given loop.
    • dpadLeft

      public Trigger dpadLeft()
      Constructs a Trigger instance around the D-pad left button's digital signal.
      Returns:
      a Trigger instance representing the D-pad left button's digital signal attached to the default scheduler event loop on the scheduler passed to the controller's constructor, or the default scheduler if a scheduler was not explicitly provided.
      See Also:
    • dpadLeft

      public Trigger dpadLeft(EventLoop loop)
      Constructs a Trigger instance around the D-pad left button's digital signal.
      Parameters:
      loop - the event loop instance to attach the event to.
      Returns:
      a Trigger instance representing the D-pad left button's digital signal attached to the given loop.
    • dpadRight

      public Trigger dpadRight()
      Constructs a Trigger instance around the D-pad right button's digital signal.
      Returns:
      a Trigger instance representing the D-pad right button's digital signal attached to the default scheduler event loop on the scheduler passed to the controller's constructor, or the default scheduler if a scheduler was not explicitly provided.
      See Also:
    • dpadRight

      public Trigger dpadRight(EventLoop loop)
      Constructs a Trigger instance around the D-pad right button's digital signal.
      Parameters:
      loop - the event loop instance to attach the event to.
      Returns:
      a Trigger instance representing the D-pad right button's digital signal attached to the given loop.
    • misc1

      public Trigger misc1()
      Constructs a Trigger instance around the Miscellaneous 1 button's digital signal.
      Returns:
      a Trigger instance representing the Miscellaneous 1 button's digital signal attached to the default scheduler event loop on the scheduler passed to the controller's constructor, or the default scheduler if a scheduler was not explicitly provided.
      See Also:
    • misc1

      public Trigger misc1(EventLoop loop)
      Constructs a Trigger instance around the Miscellaneous 1 button's digital signal.
      Parameters:
      loop - the event loop instance to attach the event to.
      Returns:
      a Trigger instance representing the Miscellaneous 1 button's digital signal attached to the given loop.
    • rightPaddle1

      public Trigger rightPaddle1()
      Constructs a Trigger instance around the Right Paddle 1 button's digital signal.
      Returns:
      a Trigger instance representing the Right Paddle 1 button's digital signal attached to the default scheduler event loop on the scheduler passed to the controller's constructor, or the default scheduler if a scheduler was not explicitly provided.
      See Also:
    • rightPaddle1

      public Trigger rightPaddle1(EventLoop loop)
      Constructs a Trigger instance around the Right Paddle 1 button's digital signal.
      Parameters:
      loop - the event loop instance to attach the event to.
      Returns:
      a Trigger instance representing the Right Paddle 1 button's digital signal attached to the given loop.
    • leftPaddle1

      public Trigger leftPaddle1()
      Constructs a Trigger instance around the Left Paddle 1 button's digital signal.
      Returns:
      a Trigger instance representing the Left Paddle 1 button's digital signal attached to the default scheduler event loop on the scheduler passed to the controller's constructor, or the default scheduler if a scheduler was not explicitly provided.
      See Also:
    • leftPaddle1

      public Trigger leftPaddle1(EventLoop loop)
      Constructs a Trigger instance around the Left Paddle 1 button's digital signal.
      Parameters:
      loop - the event loop instance to attach the event to.
      Returns:
      a Trigger instance representing the Left Paddle 1 button's digital signal attached to the given loop.
    • rightPaddle2

      public Trigger rightPaddle2()
      Constructs a Trigger instance around the Right Paddle 2 button's digital signal.
      Returns:
      a Trigger instance representing the Right Paddle 2 button's digital signal attached to the default scheduler event loop on the scheduler passed to the controller's constructor, or the default scheduler if a scheduler was not explicitly provided.
      See Also:
    • rightPaddle2

      public Trigger rightPaddle2(EventLoop loop)
      Constructs a Trigger instance around the Right Paddle 2 button's digital signal.
      Parameters:
      loop - the event loop instance to attach the event to.
      Returns:
      a Trigger instance representing the Right Paddle 2 button's digital signal attached to the given loop.
    • leftPaddle2

      public Trigger leftPaddle2()
      Constructs a Trigger instance around the Left Paddle 2 button's digital signal.
      Returns:
      a Trigger instance representing the Left Paddle 2 button's digital signal attached to the default scheduler event loop on the scheduler passed to the controller's constructor, or the default scheduler if a scheduler was not explicitly provided.
      See Also:
    • leftPaddle2

      public Trigger leftPaddle2(EventLoop loop)
      Constructs a Trigger instance around the Left Paddle 2 button's digital signal.
      Parameters:
      loop - the event loop instance to attach the event to.
      Returns:
      a Trigger instance representing the Left Paddle 2 button's digital signal attached to the given loop.
    • touchpad

      public Trigger touchpad()
      Constructs a Trigger instance around the Touchpad button's digital signal.
      Returns:
      a Trigger instance representing the Touchpad button's digital signal attached to the default scheduler event loop on the scheduler passed to the controller's constructor, or the default scheduler if a scheduler was not explicitly provided.
      See Also:
    • touchpad

      public Trigger touchpad(EventLoop loop)
      Constructs a Trigger instance around the Touchpad button's digital signal.
      Parameters:
      loop - the event loop instance to attach the event to.
      Returns:
      a Trigger instance representing the Touchpad button's digital signal attached to the given loop.
    • misc2

      public Trigger misc2()
      Constructs a Trigger instance around the Miscellaneous 2 button's digital signal.
      Returns:
      a Trigger instance representing the Miscellaneous 2 button's digital signal attached to the default scheduler event loop on the scheduler passed to the controller's constructor, or the default scheduler if a scheduler was not explicitly provided.
      See Also:
    • misc2

      public Trigger misc2(EventLoop loop)
      Constructs a Trigger instance around the Miscellaneous 2 button's digital signal.
      Parameters:
      loop - the event loop instance to attach the event to.
      Returns:
      a Trigger instance representing the Miscellaneous 2 button's digital signal attached to the given loop.
    • misc3

      public Trigger misc3()
      Constructs a Trigger instance around the Miscellaneous 3 button's digital signal.
      Returns:
      a Trigger instance representing the Miscellaneous 3 button's digital signal attached to the default scheduler event loop on the scheduler passed to the controller's constructor, or the default scheduler if a scheduler was not explicitly provided.
      See Also:
    • misc3

      public Trigger misc3(EventLoop loop)
      Constructs a Trigger instance around the Miscellaneous 3 button's digital signal.
      Parameters:
      loop - the event loop instance to attach the event to.
      Returns:
      a Trigger instance representing the Miscellaneous 3 button's digital signal attached to the given loop.
    • misc4

      public Trigger misc4()
      Constructs a Trigger instance around the Miscellaneous 4 button's digital signal.
      Returns:
      a Trigger instance representing the Miscellaneous 4 button's digital signal attached to the default scheduler event loop on the scheduler passed to the controller's constructor, or the default scheduler if a scheduler was not explicitly provided.
      See Also:
    • misc4

      public Trigger misc4(EventLoop loop)
      Constructs a Trigger instance around the Miscellaneous 4 button's digital signal.
      Parameters:
      loop - the event loop instance to attach the event to.
      Returns:
      a Trigger instance representing the Miscellaneous 4 button's digital signal attached to the given loop.
    • misc5

      public Trigger misc5()
      Constructs a Trigger instance around the Miscellaneous 5 button's digital signal.
      Returns:
      a Trigger instance representing the Miscellaneous 5 button's digital signal attached to the default scheduler event loop on the scheduler passed to the controller's constructor, or the default scheduler if a scheduler was not explicitly provided.
      See Also:
    • misc5

      public Trigger misc5(EventLoop loop)
      Constructs a Trigger instance around the Miscellaneous 5 button's digital signal.
      Parameters:
      loop - the event loop instance to attach the event to.
      Returns:
      a Trigger instance representing the Miscellaneous 5 button's digital signal attached to the given loop.
    • misc6

      public Trigger misc6()
      Constructs a Trigger instance around the Miscellaneous 6 button's digital signal.
      Returns:
      a Trigger instance representing the Miscellaneous 6 button's digital signal attached to the default scheduler event loop on the scheduler passed to the controller's constructor, or the default scheduler if a scheduler was not explicitly provided.
      See Also:
    • misc6

      public Trigger misc6(EventLoop loop)
      Constructs a Trigger instance around the Miscellaneous 6 button's digital signal.
      Parameters:
      loop - the event loop instance to attach the event to.
      Returns:
      a Trigger instance representing the Miscellaneous 6 button's digital signal attached to the given loop.
    • leftTrigger

      public Trigger leftTrigger(double threshold, EventLoop loop)
      Constructs a Trigger instance around the axis value of the left trigger. The returned trigger will be true when the axis value is greater than threshold.
      Parameters:
      threshold - the minimum axis value for the returned Trigger to be true. This value should be in the range [0, 1] where 0 is the unpressed state of the axis.
      loop - the event loop instance to attach the Trigger to.
      Returns:
      a Trigger instance that is true when the left trigger's axis exceeds the provided threshold, attached to the given event loop
    • leftTrigger

      public Trigger leftTrigger(double threshold)
      Constructs a Trigger instance around the axis value of the left trigger. The returned trigger will be true when the axis value is greater than threshold.
      Parameters:
      threshold - the minimum axis value for the returned Trigger to be true. This value should be in the range [0, 1] where 0 is the unpressed state of the axis.
      Returns:
      a Trigger instance that is true when the left trigger's axis exceeds the provided threshold, attached to the default scheduler button loop.
    • leftTrigger

      public Trigger leftTrigger()
      Constructs a Trigger instance around the axis value of the left trigger. The returned trigger will be true when the axis value is greater than 0.5.
      Returns:
      a Trigger instance that is true when the left trigger's axis exceeds 0.5, attached to the default scheduler event loop on the scheduler passed to the controller's constructor, or the default scheduler if a scheduler was not explicitly provided.
    • rightTrigger

      public Trigger rightTrigger(double threshold, EventLoop loop)
      Constructs a Trigger instance around the axis value of the right trigger. The returned trigger will be true when the axis value is greater than threshold.
      Parameters:
      threshold - the minimum axis value for the returned Trigger to be true. This value should be in the range [0, 1] where 0 is the unpressed state of the axis.
      loop - the event loop instance to attach the Trigger to.
      Returns:
      a Trigger instance that is true when the right trigger's axis exceeds the provided threshold, attached to the given event loop
    • rightTrigger

      public Trigger rightTrigger(double threshold)
      Constructs a Trigger instance around the axis value of the right trigger. The returned trigger will be true when the axis value is greater than threshold.
      Parameters:
      threshold - the minimum axis value for the returned Trigger to be true. This value should be in the range [0, 1] where 0 is the unpressed state of the axis.
      Returns:
      a Trigger instance that is true when the right trigger's axis exceeds the provided threshold, attached to the default scheduler button loop.
    • rightTrigger

      public Trigger rightTrigger()
      Constructs a Trigger instance around the axis value of the right trigger. The returned trigger will be true when the axis value is greater than 0.5.
      Returns:
      a Trigger instance that is true when the right trigger's axis exceeds 0.5, attached to the default scheduler event loop on the scheduler passed to the controller's constructor, or the default scheduler if a scheduler was not explicitly provided.
    • getLeftX

      public double getLeftX()
      Get the X axis value of left side of the controller. Right is positive.
      Returns:
      The axis value.
    • getLeftY

      public double getLeftY()
      Get the Y axis value of left side of the controller. Back is positive.
      Returns:
      The axis value.
    • getRightX

      public double getRightX()
      Get the X axis value of right side of the controller. Right is positive.
      Returns:
      The axis value.
    • getRightY

      public double getRightY()
      Get the Y axis value of right side of the controller. Back is positive.
      Returns:
      The axis value.
    • getLeftTrigger

      public double getLeftTrigger()
      Get the left trigger value of the controller. Note that this axis is bound to the range of [0, 1] as opposed to the usual [-1, 1].
      Returns:
      The axis value.
    • getRightTrigger

      public double getRightTrigger()
      Get the right trigger value of the controller. Note that this axis is bound to the range of [0, 1] as opposed to the usual [-1, 1].
      Returns:
      The axis value.