Class CommandGamepad
java.lang.Object
org.wpilib.command2.button.CommandGenericHID
org.wpilib.command2.button.CommandGamepad
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionback()Constructs a Trigger instance around the Back button's digital signal.Constructs a Trigger instance around the Back button's digital signal.dpadDown()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.dpadLeft()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.dpadUp()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.eastFace()Constructs a Trigger instance around the East Face button's digital signal.Constructs a Trigger instance around the East Face button's digital signal.getHID()Get the underlying GenericHID object.doubleGet the left trigger axis value of the controller.doublegetLeftX()Get the X axis value of left side of the controller.doublegetLeftY()Get the Y axis value of left side of the controller.doubleGet the right trigger axis value of the controller.doubleGet the X axis value of right side of the controller.doubleGet the Y axis value of right side of the controller.guide()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.leftBumper(EventLoop loop) 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.leftPaddle1(EventLoop loop) 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.leftPaddle2(EventLoop loop) 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.misc1()Constructs a Trigger instance around the Miscellaneous 1 button's digital signal.Constructs a Trigger instance around the Miscellaneous 1 button's digital signal.misc2()Constructs a Trigger instance around the Miscellaneous 2 button's digital signal.Constructs a Trigger instance around the Miscellaneous 2 button's digital signal.misc3()Constructs a Trigger instance around the Miscellaneous 3 button's digital signal.Constructs a Trigger instance around the Miscellaneous 3 button's digital signal.misc4()Constructs a Trigger instance around the Miscellaneous 4 button's digital signal.Constructs a Trigger instance around the Miscellaneous 4 button's digital signal.misc5()Constructs a Trigger instance around the Miscellaneous 5 button's digital signal.Constructs a Trigger instance around the Miscellaneous 5 button's digital signal.misc6()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 North Face button's digital signal.Constructs a Trigger instance around the North Face button's digital signal.Constructs a Trigger instance around the right bumper button's digital signal.rightBumper(EventLoop loop) 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.rightPaddle1(EventLoop loop) 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.rightPaddle2(EventLoop loop) 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.rightStick(EventLoop loop) 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 South Face button's digital signal.Constructs a Trigger instance around the South Face button's digital signal.start()Constructs a Trigger instance around the Start button's digital signal.Constructs a Trigger instance around the Start button's digital signal.touchpad()Constructs a Trigger instance around the Touchpad button's digital signal.Constructs a Trigger instance around the Touchpad button's digital signal.westFace()Constructs a Trigger instance around the West Face button's digital signal.Constructs a Trigger instance around the West Face button's digital signal.Methods inherited from class CommandGenericHID
axisGreaterThan, axisGreaterThan, axisLessThan, axisLessThan, axisMagnitudeGreaterThan, axisMagnitudeGreaterThan, button, button, getRawAxis, isConnected, pov, pov, povCenter, povDown, povDownLeft, povDownRight, povLeft, povRight, povUp, povUpLeft, povUpRight, setRumble
-
Constructor Details
-
CommandGamepad
Construct an instance of a controller.- Parameters:
port- The port index on the Driver Station that the controller is plugged into.
-
-
Method Details
-
getHID
Get the underlying GenericHID object.- Overrides:
getHIDin classCommandGenericHID- Returns:
- the wrapped GenericHID object
-
southFace
Constructs a Trigger instance around the South Face button's digital signal.- Returns:
- a Trigger instance representing the South Face button's digital signal attached to the
default scheduler button loop. - See Also:
-
southFace
-
eastFace
Constructs a Trigger instance around the East Face button's digital signal.- Returns:
- a Trigger instance representing the East Face button's digital signal attached to the
default scheduler button loop. - See Also:
-
eastFace
-
westFace
Constructs a Trigger instance around the West Face button's digital signal.- Returns:
- a Trigger instance representing the West Face button's digital signal attached to the
default scheduler button loop. - See Also:
-
westFace
-
northFace
Constructs a Trigger instance around the North Face button's digital signal.- Returns:
- a Trigger instance representing the North Face button's digital signal attached to the
default scheduler button loop. - See Also:
-
northFace
-
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 button loop. - See Also:
-
back
-
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 button loop. - See Also:
-
guide
-
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 button loop. - See Also:
-
start
-
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 button loop. - See Also:
-
leftStick
-
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 button loop. - See Also:
-
rightStick
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
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 button loop. - See Also:
-
leftBumper
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
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 button loop. - See Also:
-
rightBumper
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
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 button loop. - See Also:
-
dpadUp
-
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 button loop. - See Also:
-
dpadDown
-
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 button loop. - See Also:
-
dpadLeft
-
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 button loop. - See Also:
-
dpadRight
-
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 button loop. - See Also:
-
misc1
-
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 button loop. - See Also:
-
rightPaddle1
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
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 button loop. - See Also:
-
leftPaddle1
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
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 button loop. - See Also:
-
rightPaddle2
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
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 button loop. - See Also:
-
leftPaddle2
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
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 button loop. - See Also:
-
touchpad
-
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 button loop. - See Also:
-
misc2
-
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 button loop. - See Also:
-
misc3
-
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 button loop. - See Also:
-
misc4
-
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 button loop. - See Also:
-
misc5
-
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 button loop. - See Also:
-
misc6
-
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 thanthreshold.- Parameters:
threshold- the minimum axis value for the returnedTriggerto 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
Constructs a Trigger instance around the axis value of the left trigger. The returned trigger will be true when the axis value is greater thanthreshold.- Parameters:
threshold- the minimum axis value for the returnedTriggerto 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
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 button loop.
-
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 thanthreshold.- Parameters:
threshold- the minimum axis value for the returnedTriggerto 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
Constructs a Trigger instance around the axis value of the right trigger. The returned trigger will be true when the axis value is greater thanthreshold.- Parameters:
threshold- the minimum axis value for the returnedTriggerto 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
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 button loop.
-
getLeftX
Get the X axis value of left side of the controller. Right is positive.- Returns:
- The axis value.
-
getLeftY
Get the Y axis value of left side of the controller. Back is positive.- Returns:
- The axis value.
-
getRightX
Get the X axis value of right side of the controller. Right is positive.- Returns:
- The axis value.
-
getRightY
Get the Y axis value of right side of the controller. Back is positive.- Returns:
- The axis value.
-
getLeftTriggerAxis
Get the left trigger axis 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.
-
getRightTriggerAxis
Get the right trigger axis 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.
-