RobotCore 1.0
WPILib port to raspberry Pi
Loading...
Searching...
No Matches
org.wpilib.driverstation.Gamepad Class Reference
Inheritance diagram for org.wpilib.driverstation.Gamepad:
org.wpilib.driverstation.HIDDevice org.wpilib.telemetry.TelemetryLoggable

Classes

enum  Button
enum  Axis

Public Member Functions

GenericHID getHID ()
 Gamepad (final int port)
 Gamepad (final GenericHID hid)
void setLeftXDeadband (double deadband)
void setLeftYDeadband (double deadband)
void setRightXDeadband (double deadband)
void setRightYDeadband (double deadband)
void setLeftTriggerDeadband (double deadband)
void setRightTriggerDeadband (double deadband)
double getLeftX ()
double getLeftY ()
double getRightX ()
double getRightY ()
double getLeftTrigger ()
BooleanEvent leftTrigger (double threshold, EventLoop loop)
BooleanEvent leftTrigger (EventLoop loop)
double getRightTrigger ()
BooleanEvent rightTrigger (double threshold, EventLoop loop)
BooleanEvent rightTrigger (EventLoop loop)
boolean getFaceDownButton ()
boolean getFaceDownButtonPressed ()
boolean getFaceDownButtonReleased ()
BooleanEvent faceDown (EventLoop loop)
boolean getFaceRightButton ()
boolean getFaceRightButtonPressed ()
boolean getFaceRightButtonReleased ()
BooleanEvent faceRight (EventLoop loop)
boolean getFaceLeftButton ()
boolean getFaceLeftButtonPressed ()
boolean getFaceLeftButtonReleased ()
BooleanEvent faceLeft (EventLoop loop)
boolean getFaceUpButton ()
boolean getFaceUpButtonPressed ()
boolean getFaceUpButtonReleased ()
BooleanEvent faceUp (EventLoop loop)
boolean getBackButton ()
boolean getBackButtonPressed ()
boolean getBackButtonReleased ()
BooleanEvent back (EventLoop loop)
boolean getGuideButton ()
boolean getGuideButtonPressed ()
boolean getGuideButtonReleased ()
BooleanEvent guide (EventLoop loop)
boolean getStartButton ()
boolean getStartButtonPressed ()
boolean getStartButtonReleased ()
BooleanEvent start (EventLoop loop)
boolean getLeftStickButton ()
boolean getLeftStickButtonPressed ()
boolean getLeftStickButtonReleased ()
BooleanEvent leftStick (EventLoop loop)
boolean getRightStickButton ()
boolean getRightStickButtonPressed ()
boolean getRightStickButtonReleased ()
BooleanEvent rightStick (EventLoop loop)
boolean getLeftBumperButton ()
boolean getLeftBumperButtonPressed ()
boolean getLeftBumperButtonReleased ()
BooleanEvent leftBumper (EventLoop loop)
boolean getRightBumperButton ()
boolean getRightBumperButtonPressed ()
boolean getRightBumperButtonReleased ()
BooleanEvent rightBumper (EventLoop loop)
boolean getDpadUpButton ()
boolean getDpadUpButtonPressed ()
boolean getDpadUpButtonReleased ()
BooleanEvent dpadUp (EventLoop loop)
boolean getDpadDownButton ()
boolean getDpadDownButtonPressed ()
boolean getDpadDownButtonReleased ()
BooleanEvent dpadDown (EventLoop loop)
boolean getDpadLeftButton ()
boolean getDpadLeftButtonPressed ()
boolean getDpadLeftButtonReleased ()
BooleanEvent dpadLeft (EventLoop loop)
boolean getDpadRightButton ()
boolean getDpadRightButtonPressed ()
boolean getDpadRightButtonReleased ()
BooleanEvent dpadRight (EventLoop loop)
boolean getMisc1Button ()
boolean getMisc1ButtonPressed ()
boolean getMisc1ButtonReleased ()
BooleanEvent misc1 (EventLoop loop)
boolean getRightPaddle1Button ()
boolean getRightPaddle1ButtonPressed ()
boolean getRightPaddle1ButtonReleased ()
BooleanEvent rightPaddle1 (EventLoop loop)
boolean getLeftPaddle1Button ()
boolean getLeftPaddle1ButtonPressed ()
boolean getLeftPaddle1ButtonReleased ()
BooleanEvent leftPaddle1 (EventLoop loop)
boolean getRightPaddle2Button ()
boolean getRightPaddle2ButtonPressed ()
boolean getRightPaddle2ButtonReleased ()
BooleanEvent rightPaddle2 (EventLoop loop)
boolean getLeftPaddle2Button ()
boolean getLeftPaddle2ButtonPressed ()
boolean getLeftPaddle2ButtonReleased ()
BooleanEvent leftPaddle2 (EventLoop loop)
boolean getTouchpadButton ()
boolean getTouchpadButtonPressed ()
boolean getTouchpadButtonReleased ()
BooleanEvent touchpad (EventLoop loop)
boolean getMisc2Button ()
boolean getMisc2ButtonPressed ()
boolean getMisc2ButtonReleased ()
BooleanEvent misc2 (EventLoop loop)
boolean getMisc3Button ()
boolean getMisc3ButtonPressed ()
boolean getMisc3ButtonReleased ()
BooleanEvent misc3 (EventLoop loop)
boolean getMisc4Button ()
boolean getMisc4ButtonPressed ()
boolean getMisc4ButtonReleased ()
BooleanEvent misc4 (EventLoop loop)
boolean getMisc5Button ()
boolean getMisc5ButtonPressed ()
boolean getMisc5ButtonReleased ()
BooleanEvent misc5 (EventLoop loop)
boolean getMisc6Button ()
boolean getMisc6ButtonPressed ()
boolean getMisc6ButtonReleased ()
BooleanEvent misc6 (EventLoop loop)
boolean getButton (Button button)
boolean getButtonPressed (Button button)
boolean getButtonReleased (Button button)
BooleanEvent button (Button button, EventLoop loop)
double getAxis (Axis axis)
BooleanEvent axisLessThan (Axis axis, double threshold, EventLoop loop)
BooleanEvent axisGreaterThan (Axis axis, double threshold, EventLoop loop)
int getAxesAvailable ()
long getButtonsAvailable ()
boolean isConnected ()
HIDType getGamepadType ()
EnumSet< SupportedOutput > getSupportedOutputs ()
String getName ()
void setLeds (int r, int g, int b)
void setRumble (RumbleType type, double value)
boolean getTouchpadFingerAvailable (int touchpad, int finger)
TouchpadFinger getTouchpadFinger (int touchpad, int finger)
void logTo (TelemetryTable table)
String getTelemetryType ()

Additional Inherited Members

Public Attributes inherited from org.wpilib.driverstation.HIDDevice
int MAX_DEVICES = DriverStationBackend.JOYSTICK_PORTS

Detailed Description

Handle input from Gamepad controllers connected to the Driver Station.

This class handles Gamepad input that comes from the Driver Station. Each time a value is requested the most recent value is returned. There is a single class instance for each controller and the mapping of ports to hardware buttons depends on the code in the Driver Station.

Definition at line 27 of file Gamepad.java.

Constructor & Destructor Documentation

◆ Gamepad() [1/2]

org.wpilib.driverstation.Gamepad.Gamepad ( final int port)

Construct an instance of a gamepad.

Parameters
portThe port index on the Driver Station that the gamepad is plugged into (0-5).

Definition at line 177 of file Gamepad.java.

◆ Gamepad() [2/2]

org.wpilib.driverstation.Gamepad.Gamepad ( final GenericHID hid)

Construct an instance of a gamepad with a GenericHID object.

Parameters
hidThe GenericHID object to use for this gamepad.

Definition at line 186 of file Gamepad.java.

Member Function Documentation

◆ axisGreaterThan()

BooleanEvent org.wpilib.driverstation.Gamepad.axisGreaterThan ( Axis axis,
double threshold,
EventLoop loop )

Constructs an event instance that is true when the axis value is greater than
threshold
, attached to the given loop.

Parameters
axisThe axis to read, starting at 0
thresholdThe value above which this event should return true.
loopthe event loop instance to attach the event to.
Returns
an event instance that is true when the axis value is greater than the provided threshold.

Definition at line 1450 of file Gamepad.java.

◆ axisLessThan()

BooleanEvent org.wpilib.driverstation.Gamepad.axisLessThan ( Axis axis,
double threshold,
EventLoop loop )

Constructs an event instance that is true when the axis value is less than threshold, attached to the given loop.

Parameters
axisThe axis to read, starting at 0
thresholdThe value below which this event should return true.
loopthe event loop instance to attach the event to.
Returns
an event instance that is true when the axis value is less than the provided threshold.

Definition at line 1436 of file Gamepad.java.

◆ back()

BooleanEvent org.wpilib.driverstation.Gamepad.back ( EventLoop loop)

Constructs an event instance around the Back button's digital signal.

Parameters
loopthe event loop instance to attach the event to.
Returns
an event instance representing the Back button's digital signal attached to the given loop.

Definition at line 563 of file Gamepad.java.

◆ button()

BooleanEvent org.wpilib.driverstation.Gamepad.button ( Button button,
EventLoop loop )

Constructs an event instance around this button's digital signal.

Parameters
buttonthe button
loopthe event loop instance to attach the event to.
Returns
an event instance representing the button's digital signal attached to the given loop.

Definition at line 1413 of file Gamepad.java.

◆ dpadDown()

BooleanEvent org.wpilib.driverstation.Gamepad.dpadDown ( EventLoop loop)

Constructs an event instance around the D-pad down button's digital signal.

Parameters
loopthe event loop instance to attach the event to.
Returns
an event instance representing the D-pad down button's digital signal attached to the given loop.

Definition at line 867 of file Gamepad.java.

◆ dpadLeft()

BooleanEvent org.wpilib.driverstation.Gamepad.dpadLeft ( EventLoop loop)

Constructs an event instance around the D-pad left button's digital signal.

Parameters
loopthe event loop instance to attach the event to.
Returns
an event instance representing the D-pad left button's digital signal attached to the given loop.

Definition at line 905 of file Gamepad.java.

◆ dpadRight()

BooleanEvent org.wpilib.driverstation.Gamepad.dpadRight ( EventLoop loop)

Constructs an event instance around the D-pad right button's digital signal.

Parameters
loopthe event loop instance to attach the event to.
Returns
an event instance representing the D-pad right button's digital signal attached to the given loop.

Definition at line 943 of file Gamepad.java.

◆ dpadUp()

BooleanEvent org.wpilib.driverstation.Gamepad.dpadUp ( EventLoop loop)

Constructs an event instance around the D-pad up button's digital signal.

Parameters
loopthe event loop instance to attach the event to.
Returns
an event instance representing the D-pad up button's digital signal attached to the given loop.

Definition at line 829 of file Gamepad.java.

◆ faceDown()

BooleanEvent org.wpilib.driverstation.Gamepad.faceDown ( EventLoop loop)

Constructs an event instance around the Face Down button's digital signal.

Parameters
loopthe event loop instance to attach the event to.
Returns
an event instance representing the Face Down button's digital signal attached to the given loop.

Definition at line 411 of file Gamepad.java.

◆ faceLeft()

BooleanEvent org.wpilib.driverstation.Gamepad.faceLeft ( EventLoop loop)

Constructs an event instance around the Face Left button's digital signal.

Parameters
loopthe event loop instance to attach the event to.
Returns
an event instance representing the Face Left button's digital signal attached to the given loop.

Definition at line 487 of file Gamepad.java.

◆ faceRight()

BooleanEvent org.wpilib.driverstation.Gamepad.faceRight ( EventLoop loop)

Constructs an event instance around the Face Right button's digital signal.

Parameters
loopthe event loop instance to attach the event to.
Returns
an event instance representing the Face Right button's digital signal attached to the given loop.

Definition at line 449 of file Gamepad.java.

◆ faceUp()

BooleanEvent org.wpilib.driverstation.Gamepad.faceUp ( EventLoop loop)

Constructs an event instance around the Face Up button's digital signal.

Parameters
loopthe event loop instance to attach the event to.
Returns
an event instance representing the Face Up button's digital signal attached to the given loop.

Definition at line 525 of file Gamepad.java.

◆ getAxesAvailable()

int org.wpilib.driverstation.Gamepad.getAxesAvailable ( )

Get the bitmask of axes for the gamepad.

Returns
the number of axis for the current gamepad

Definition at line 1459 of file Gamepad.java.

◆ getAxis()

double org.wpilib.driverstation.Gamepad.getAxis ( Axis axis)

Get the value of the axis.

Parameters
axisThe axis to read
Returns
The value of the axis.

Definition at line 1423 of file Gamepad.java.

◆ getBackButton()

boolean org.wpilib.driverstation.Gamepad.getBackButton ( )

Read the value of the Back button on the controller.

Returns
The state of the button.

Definition at line 534 of file Gamepad.java.

◆ getBackButtonPressed()

boolean org.wpilib.driverstation.Gamepad.getBackButtonPressed ( )

Whether the Back button was pressed since the last check.

Returns
Whether the button was pressed since the last check.

Definition at line 543 of file Gamepad.java.

◆ getBackButtonReleased()

boolean org.wpilib.driverstation.Gamepad.getBackButtonReleased ( )

Whether the Back button was released since the last check.

Returns
Whether the button was released since the last check.

Definition at line 552 of file Gamepad.java.

◆ getButton()

boolean org.wpilib.driverstation.Gamepad.getButton ( Button button)

Get the button value (starting at button 1).

This method returns true if the button is being held down at the time that this method is being called.

Parameters
buttonThe button
Returns
The state of the button.

Definition at line 1374 of file Gamepad.java.

◆ getButtonPressed()

boolean org.wpilib.driverstation.Gamepad.getButtonPressed ( Button button)

Whether the button was pressed since the last check.

This method returns true if the button went from not pressed to held down since the last time this method was called. This is useful if you only want to call a function once when you press the button.

Parameters
buttonThe button
Returns
Whether the button was pressed since the last check.

Definition at line 1388 of file Gamepad.java.

◆ getButtonReleased()

boolean org.wpilib.driverstation.Gamepad.getButtonReleased ( Button button)

Whether the button was released since the last check.

This method returns true if the button went from held down to not pressed since the last time this method was called. This is useful if you only want to call a function once when you release the button.

Parameters
buttonThe button
Returns
Whether the button was released since the last check.

Definition at line 1402 of file Gamepad.java.

◆ getButtonsAvailable()

long org.wpilib.driverstation.Gamepad.getButtonsAvailable ( )

For the current gamepad, return the bitmask of available buttons.

Returns
the bitmask of buttons for the current gamepad

Definition at line 1468 of file Gamepad.java.

◆ getDpadDownButton()

boolean org.wpilib.driverstation.Gamepad.getDpadDownButton ( )

Read the value of the D-pad down button on the controller.

Returns
The state of the button.

Definition at line 838 of file Gamepad.java.

◆ getDpadDownButtonPressed()

boolean org.wpilib.driverstation.Gamepad.getDpadDownButtonPressed ( )

Whether the D-pad down button was pressed since the last check.

Returns
Whether the button was pressed since the last check.

Definition at line 847 of file Gamepad.java.

◆ getDpadDownButtonReleased()

boolean org.wpilib.driverstation.Gamepad.getDpadDownButtonReleased ( )

Whether the D-pad down button was released since the last check.

Returns
Whether the button was released since the last check.

Definition at line 856 of file Gamepad.java.

◆ getDpadLeftButton()

boolean org.wpilib.driverstation.Gamepad.getDpadLeftButton ( )

Read the value of the D-pad left button on the controller.

Returns
The state of the button.

Definition at line 876 of file Gamepad.java.

◆ getDpadLeftButtonPressed()

boolean org.wpilib.driverstation.Gamepad.getDpadLeftButtonPressed ( )

Whether the D-pad left button was pressed since the last check.

Returns
Whether the button was pressed since the last check.

Definition at line 885 of file Gamepad.java.

◆ getDpadLeftButtonReleased()

boolean org.wpilib.driverstation.Gamepad.getDpadLeftButtonReleased ( )

Whether the D-pad left button was released since the last check.

Returns
Whether the button was released since the last check.

Definition at line 894 of file Gamepad.java.

◆ getDpadRightButton()

boolean org.wpilib.driverstation.Gamepad.getDpadRightButton ( )

Read the value of the D-pad right button on the controller.

Returns
The state of the button.

Definition at line 914 of file Gamepad.java.

◆ getDpadRightButtonPressed()

boolean org.wpilib.driverstation.Gamepad.getDpadRightButtonPressed ( )

Whether the D-pad right button was pressed since the last check.

Returns
Whether the button was pressed since the last check.

Definition at line 923 of file Gamepad.java.

◆ getDpadRightButtonReleased()

boolean org.wpilib.driverstation.Gamepad.getDpadRightButtonReleased ( )

Whether the D-pad right button was released since the last check.

Returns
Whether the button was released since the last check.

Definition at line 932 of file Gamepad.java.

◆ getDpadUpButton()

boolean org.wpilib.driverstation.Gamepad.getDpadUpButton ( )

Read the value of the D-pad up button on the controller.

Returns
The state of the button.

Definition at line 800 of file Gamepad.java.

◆ getDpadUpButtonPressed()

boolean org.wpilib.driverstation.Gamepad.getDpadUpButtonPressed ( )

Whether the D-pad up button was pressed since the last check.

Returns
Whether the button was pressed since the last check.

Definition at line 809 of file Gamepad.java.

◆ getDpadUpButtonReleased()

boolean org.wpilib.driverstation.Gamepad.getDpadUpButtonReleased ( )

Whether the D-pad up button was released since the last check.

Returns
Whether the button was released since the last check.

Definition at line 818 of file Gamepad.java.

◆ getFaceDownButton()

boolean org.wpilib.driverstation.Gamepad.getFaceDownButton ( )

Read the value of the Face Down button on the controller.

Returns
The state of the button.

Definition at line 382 of file Gamepad.java.

◆ getFaceDownButtonPressed()

boolean org.wpilib.driverstation.Gamepad.getFaceDownButtonPressed ( )

Whether the Face Down button was pressed since the last check.

Returns
Whether the button was pressed since the last check.

Definition at line 391 of file Gamepad.java.

◆ getFaceDownButtonReleased()

boolean org.wpilib.driverstation.Gamepad.getFaceDownButtonReleased ( )

Whether the Face Down button was released since the last check.

Returns
Whether the button was released since the last check.

Definition at line 400 of file Gamepad.java.

◆ getFaceLeftButton()

boolean org.wpilib.driverstation.Gamepad.getFaceLeftButton ( )

Read the value of the Face Left button on the controller.

Returns
The state of the button.

Definition at line 458 of file Gamepad.java.

◆ getFaceLeftButtonPressed()

boolean org.wpilib.driverstation.Gamepad.getFaceLeftButtonPressed ( )

Whether the Face Left button was pressed since the last check.

Returns
Whether the button was pressed since the last check.

Definition at line 467 of file Gamepad.java.

◆ getFaceLeftButtonReleased()

boolean org.wpilib.driverstation.Gamepad.getFaceLeftButtonReleased ( )

Whether the Face Left button was released since the last check.

Returns
Whether the button was released since the last check.

Definition at line 476 of file Gamepad.java.

◆ getFaceRightButton()

boolean org.wpilib.driverstation.Gamepad.getFaceRightButton ( )

Read the value of the Face Right button on the controller.

Returns
The state of the button.

Definition at line 420 of file Gamepad.java.

◆ getFaceRightButtonPressed()

boolean org.wpilib.driverstation.Gamepad.getFaceRightButtonPressed ( )

Whether the Face Right button was pressed since the last check.

Returns
Whether the button was pressed since the last check.

Definition at line 429 of file Gamepad.java.

◆ getFaceRightButtonReleased()

boolean org.wpilib.driverstation.Gamepad.getFaceRightButtonReleased ( )

Whether the Face Right button was released since the last check.

Returns
Whether the button was released since the last check.

Definition at line 438 of file Gamepad.java.

◆ getFaceUpButton()

boolean org.wpilib.driverstation.Gamepad.getFaceUpButton ( )

Read the value of the Face Up button on the controller.

Returns
The state of the button.

Definition at line 496 of file Gamepad.java.

◆ getFaceUpButtonPressed()

boolean org.wpilib.driverstation.Gamepad.getFaceUpButtonPressed ( )

Whether the Face Up button was pressed since the last check.

Returns
Whether the button was pressed since the last check.

Definition at line 505 of file Gamepad.java.

◆ getFaceUpButtonReleased()

boolean org.wpilib.driverstation.Gamepad.getFaceUpButtonReleased ( )

Whether the Face Up button was released since the last check.

Returns
Whether the button was released since the last check.

Definition at line 514 of file Gamepad.java.

◆ getGamepadType()

HIDType org.wpilib.driverstation.Gamepad.getGamepadType ( )

Get the type of the gamepad.

Returns
the type of the gamepad.

Definition at line 1486 of file Gamepad.java.

◆ getGuideButton()

boolean org.wpilib.driverstation.Gamepad.getGuideButton ( )

Read the value of the Guide button on the controller.

Returns
The state of the button.

Definition at line 572 of file Gamepad.java.

◆ getGuideButtonPressed()

boolean org.wpilib.driverstation.Gamepad.getGuideButtonPressed ( )

Whether the Guide button was pressed since the last check.

Returns
Whether the button was pressed since the last check.

Definition at line 581 of file Gamepad.java.

◆ getGuideButtonReleased()

boolean org.wpilib.driverstation.Gamepad.getGuideButtonReleased ( )

Whether the Guide button was released since the last check.

Returns
Whether the button was released since the last check.

Definition at line 590 of file Gamepad.java.

◆ getHID()

GenericHID org.wpilib.driverstation.Gamepad.getHID ( )

Get the underlying GenericHID object.

Returns
the wrapped GenericHID object

Implements org.wpilib.driverstation.HIDDevice.

Definition at line 168 of file Gamepad.java.

◆ getLeftBumperButton()

boolean org.wpilib.driverstation.Gamepad.getLeftBumperButton ( )

Read the value of the right bumper button on the controller.

Returns
The state of the button.

Definition at line 724 of file Gamepad.java.

◆ getLeftBumperButtonPressed()

boolean org.wpilib.driverstation.Gamepad.getLeftBumperButtonPressed ( )

Whether the right bumper button was pressed since the last check.

Returns
Whether the button was pressed since the last check.

Definition at line 733 of file Gamepad.java.

◆ getLeftBumperButtonReleased()

boolean org.wpilib.driverstation.Gamepad.getLeftBumperButtonReleased ( )

Whether the right bumper button was released since the last check.

Returns
Whether the button was released since the last check.

Definition at line 742 of file Gamepad.java.

◆ getLeftPaddle1Button()

boolean org.wpilib.driverstation.Gamepad.getLeftPaddle1Button ( )

Read the value of the Left Paddle 1 button on the controller.

Returns
The state of the button.

Definition at line 1028 of file Gamepad.java.

◆ getLeftPaddle1ButtonPressed()

boolean org.wpilib.driverstation.Gamepad.getLeftPaddle1ButtonPressed ( )

Whether the Left Paddle 1 button was pressed since the last check.

Returns
Whether the button was pressed since the last check.

Definition at line 1037 of file Gamepad.java.

◆ getLeftPaddle1ButtonReleased()

boolean org.wpilib.driverstation.Gamepad.getLeftPaddle1ButtonReleased ( )

Whether the Left Paddle 1 button was released since the last check.

Returns
Whether the button was released since the last check.

Definition at line 1046 of file Gamepad.java.

◆ getLeftPaddle2Button()

boolean org.wpilib.driverstation.Gamepad.getLeftPaddle2Button ( )

Read the value of the Left Paddle 2 button on the controller.

Returns
The state of the button.

Definition at line 1104 of file Gamepad.java.

◆ getLeftPaddle2ButtonPressed()

boolean org.wpilib.driverstation.Gamepad.getLeftPaddle2ButtonPressed ( )

Whether the Left Paddle 2 button was pressed since the last check.

Returns
Whether the button was pressed since the last check.

Definition at line 1113 of file Gamepad.java.

◆ getLeftPaddle2ButtonReleased()

boolean org.wpilib.driverstation.Gamepad.getLeftPaddle2ButtonReleased ( )

Whether the Left Paddle 2 button was released since the last check.

Returns
Whether the button was released since the last check.

Definition at line 1122 of file Gamepad.java.

◆ getLeftStickButton()

boolean org.wpilib.driverstation.Gamepad.getLeftStickButton ( )

Read the value of the left stick button on the controller.

Returns
The state of the button.

Definition at line 648 of file Gamepad.java.

◆ getLeftStickButtonPressed()

boolean org.wpilib.driverstation.Gamepad.getLeftStickButtonPressed ( )

Whether the left stick button was pressed since the last check.

Returns
Whether the button was pressed since the last check.

Definition at line 657 of file Gamepad.java.

◆ getLeftStickButtonReleased()

boolean org.wpilib.driverstation.Gamepad.getLeftStickButtonReleased ( )

Whether the left stick button was released since the last check.

Returns
Whether the button was released since the last check.

Definition at line 666 of file Gamepad.java.

◆ getLeftTrigger()

double org.wpilib.driverstation.Gamepad.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].

A deadband of 0.01 is applied by default. Use setLeftTriggerDeadband to change it.

Returns
The axis value.

Definition at line 309 of file Gamepad.java.

◆ getLeftX()

double org.wpilib.driverstation.Gamepad.getLeftX ( )

Get the X axis value of left side of the controller. Right is positive.

A deadband of 0.1 is applied by default. Use setLeftXDeadband to change it.

Returns
The axis value.

Definition at line 264 of file Gamepad.java.

◆ getLeftY()

double org.wpilib.driverstation.Gamepad.getLeftY ( )

Get the Y axis value of left side of the controller. Back is positive.

A deadband of 0.1 is applied by default. Use setLeftYDeadband to change it.

Returns
The axis value.

Definition at line 275 of file Gamepad.java.

◆ getMisc1Button()

boolean org.wpilib.driverstation.Gamepad.getMisc1Button ( )

Read the value of the Miscellaneous 1 button on the controller.

Returns
The state of the button.

Definition at line 952 of file Gamepad.java.

◆ getMisc1ButtonPressed()

boolean org.wpilib.driverstation.Gamepad.getMisc1ButtonPressed ( )

Whether the Miscellaneous 1 button was pressed since the last check.

Returns
Whether the button was pressed since the last check.

Definition at line 961 of file Gamepad.java.

◆ getMisc1ButtonReleased()

boolean org.wpilib.driverstation.Gamepad.getMisc1ButtonReleased ( )

Whether the Miscellaneous 1 button was released since the last check.

Returns
Whether the button was released since the last check.

Definition at line 970 of file Gamepad.java.

◆ getMisc2Button()

boolean org.wpilib.driverstation.Gamepad.getMisc2Button ( )

Read the value of the Miscellaneous 2 button on the controller.

Returns
The state of the button.

Definition at line 1180 of file Gamepad.java.

◆ getMisc2ButtonPressed()

boolean org.wpilib.driverstation.Gamepad.getMisc2ButtonPressed ( )

Whether the Miscellaneous 2 button was pressed since the last check.

Returns
Whether the button was pressed since the last check.

Definition at line 1189 of file Gamepad.java.

◆ getMisc2ButtonReleased()

boolean org.wpilib.driverstation.Gamepad.getMisc2ButtonReleased ( )

Whether the Miscellaneous 2 button was released since the last check.

Returns
Whether the button was released since the last check.

Definition at line 1198 of file Gamepad.java.

◆ getMisc3Button()

boolean org.wpilib.driverstation.Gamepad.getMisc3Button ( )

Read the value of the Miscellaneous 3 button on the controller.

Returns
The state of the button.

Definition at line 1218 of file Gamepad.java.

◆ getMisc3ButtonPressed()

boolean org.wpilib.driverstation.Gamepad.getMisc3ButtonPressed ( )

Whether the Miscellaneous 3 button was pressed since the last check.

Returns
Whether the button was pressed since the last check.

Definition at line 1227 of file Gamepad.java.

◆ getMisc3ButtonReleased()

boolean org.wpilib.driverstation.Gamepad.getMisc3ButtonReleased ( )

Whether the Miscellaneous 3 button was released since the last check.

Returns
Whether the button was released since the last check.

Definition at line 1236 of file Gamepad.java.

◆ getMisc4Button()

boolean org.wpilib.driverstation.Gamepad.getMisc4Button ( )

Read the value of the Miscellaneous 4 button on the controller.

Returns
The state of the button.

Definition at line 1256 of file Gamepad.java.

◆ getMisc4ButtonPressed()

boolean org.wpilib.driverstation.Gamepad.getMisc4ButtonPressed ( )

Whether the Miscellaneous 4 button was pressed since the last check.

Returns
Whether the button was pressed since the last check.

Definition at line 1265 of file Gamepad.java.

◆ getMisc4ButtonReleased()

boolean org.wpilib.driverstation.Gamepad.getMisc4ButtonReleased ( )

Whether the Miscellaneous 4 button was released since the last check.

Returns
Whether the button was released since the last check.

Definition at line 1274 of file Gamepad.java.

◆ getMisc5Button()

boolean org.wpilib.driverstation.Gamepad.getMisc5Button ( )

Read the value of the Miscellaneous 5 button on the controller.

Returns
The state of the button.

Definition at line 1294 of file Gamepad.java.

◆ getMisc5ButtonPressed()

boolean org.wpilib.driverstation.Gamepad.getMisc5ButtonPressed ( )

Whether the Miscellaneous 5 button was pressed since the last check.

Returns
Whether the button was pressed since the last check.

Definition at line 1303 of file Gamepad.java.

◆ getMisc5ButtonReleased()

boolean org.wpilib.driverstation.Gamepad.getMisc5ButtonReleased ( )

Whether the Miscellaneous 5 button was released since the last check.

Returns
Whether the button was released since the last check.

Definition at line 1312 of file Gamepad.java.

◆ getMisc6Button()

boolean org.wpilib.driverstation.Gamepad.getMisc6Button ( )

Read the value of the Miscellaneous 6 button on the controller.

Returns
The state of the button.

Definition at line 1332 of file Gamepad.java.

◆ getMisc6ButtonPressed()

boolean org.wpilib.driverstation.Gamepad.getMisc6ButtonPressed ( )

Whether the Miscellaneous 6 button was pressed since the last check.

Returns
Whether the button was pressed since the last check.

Definition at line 1341 of file Gamepad.java.

◆ getMisc6ButtonReleased()

boolean org.wpilib.driverstation.Gamepad.getMisc6ButtonReleased ( )

Whether the Miscellaneous 6 button was released since the last check.

Returns
Whether the button was released since the last check.

Definition at line 1350 of file Gamepad.java.

◆ getName()

String org.wpilib.driverstation.Gamepad.getName ( )

Get the name of the gamepad.

Returns
the name of the gamepad.

Definition at line 1504 of file Gamepad.java.

◆ getRightBumperButton()

boolean org.wpilib.driverstation.Gamepad.getRightBumperButton ( )

Read the value of the right bumper button on the controller.

Returns
The state of the button.

Definition at line 762 of file Gamepad.java.

◆ getRightBumperButtonPressed()

boolean org.wpilib.driverstation.Gamepad.getRightBumperButtonPressed ( )

Whether the right bumper button was pressed since the last check.

Returns
Whether the button was pressed since the last check.

Definition at line 771 of file Gamepad.java.

◆ getRightBumperButtonReleased()

boolean org.wpilib.driverstation.Gamepad.getRightBumperButtonReleased ( )

Whether the right bumper button was released since the last check.

Returns
Whether the button was released since the last check.

Definition at line 780 of file Gamepad.java.

◆ getRightPaddle1Button()

boolean org.wpilib.driverstation.Gamepad.getRightPaddle1Button ( )

Read the value of the Right Paddle 1 button on the controller.

Returns
The state of the button.

Definition at line 990 of file Gamepad.java.

◆ getRightPaddle1ButtonPressed()

boolean org.wpilib.driverstation.Gamepad.getRightPaddle1ButtonPressed ( )

Whether the Right Paddle 1 button was pressed since the last check.

Returns
Whether the button was pressed since the last check.

Definition at line 999 of file Gamepad.java.

◆ getRightPaddle1ButtonReleased()

boolean org.wpilib.driverstation.Gamepad.getRightPaddle1ButtonReleased ( )

Whether the Right Paddle 1 button was released since the last check.

Returns
Whether the button was released since the last check.

Definition at line 1008 of file Gamepad.java.

◆ getRightPaddle2Button()

boolean org.wpilib.driverstation.Gamepad.getRightPaddle2Button ( )

Read the value of the Right Paddle 2 button on the controller.

Returns
The state of the button.

Definition at line 1066 of file Gamepad.java.

◆ getRightPaddle2ButtonPressed()

boolean org.wpilib.driverstation.Gamepad.getRightPaddle2ButtonPressed ( )

Whether the Right Paddle 2 button was pressed since the last check.

Returns
Whether the button was pressed since the last check.

Definition at line 1075 of file Gamepad.java.

◆ getRightPaddle2ButtonReleased()

boolean org.wpilib.driverstation.Gamepad.getRightPaddle2ButtonReleased ( )

Whether the Right Paddle 2 button was released since the last check.

Returns
Whether the button was released since the last check.

Definition at line 1084 of file Gamepad.java.

◆ getRightStickButton()

boolean org.wpilib.driverstation.Gamepad.getRightStickButton ( )

Read the value of the right stick button on the controller.

Returns
The state of the button.

Definition at line 686 of file Gamepad.java.

◆ getRightStickButtonPressed()

boolean org.wpilib.driverstation.Gamepad.getRightStickButtonPressed ( )

Whether the right stick button was pressed since the last check.

Returns
Whether the button was pressed since the last check.

Definition at line 695 of file Gamepad.java.

◆ getRightStickButtonReleased()

boolean org.wpilib.driverstation.Gamepad.getRightStickButtonReleased ( )

Whether the right stick button was released since the last check.

Returns
Whether the button was released since the last check.

Definition at line 704 of file Gamepad.java.

◆ getRightTrigger()

double org.wpilib.driverstation.Gamepad.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].

A deadband of 0.01 is applied by default. Use setRightTriggerDeadband to change it.

Returns
The axis value.

Definition at line 347 of file Gamepad.java.

◆ getRightX()

double org.wpilib.driverstation.Gamepad.getRightX ( )

Get the X axis value of right side of the controller. Right is positive.

A deadband of 0.1 is applied by default. Use setRightXDeadband to change it.

Returns
The axis value.

Definition at line 286 of file Gamepad.java.

◆ getRightY()

double org.wpilib.driverstation.Gamepad.getRightY ( )

Get the Y axis value of right side of the controller. Back is positive.

A deadband of 0.1 is applied by default. Use setRightYDeadband to change it.

Returns
The axis value.

Definition at line 297 of file Gamepad.java.

◆ getStartButton()

boolean org.wpilib.driverstation.Gamepad.getStartButton ( )

Read the value of the Start button on the controller.

Returns
The state of the button.

Definition at line 610 of file Gamepad.java.

◆ getStartButtonPressed()

boolean org.wpilib.driverstation.Gamepad.getStartButtonPressed ( )

Whether the Start button was pressed since the last check.

Returns
Whether the button was pressed since the last check.

Definition at line 619 of file Gamepad.java.

◆ getStartButtonReleased()

boolean org.wpilib.driverstation.Gamepad.getStartButtonReleased ( )

Whether the Start button was released since the last check.

Returns
Whether the button was released since the last check.

Definition at line 628 of file Gamepad.java.

◆ getSupportedOutputs()

EnumSet< SupportedOutput > org.wpilib.driverstation.Gamepad.getSupportedOutputs ( )

Get the supported outputs for the gamepad.

Returns
the supported outputs for the gamepad.

Definition at line 1495 of file Gamepad.java.

◆ getTelemetryType()

String org.wpilib.driverstation.Gamepad.getTelemetryType ( )

Gets the telemetry table type. Default is no specified table type (null). A mismatch in type during logging results in a reported warning, so this should always return the same value.

Returns
Table type

Implements org.wpilib.telemetry.TelemetryLoggable.

Definition at line 1596 of file Gamepad.java.

◆ getTouchpadButton()

boolean org.wpilib.driverstation.Gamepad.getTouchpadButton ( )

Read the value of the Touchpad button on the controller.

Returns
The state of the button.

Definition at line 1142 of file Gamepad.java.

◆ getTouchpadButtonPressed()

boolean org.wpilib.driverstation.Gamepad.getTouchpadButtonPressed ( )

Whether the Touchpad button was pressed since the last check.

Returns
Whether the button was pressed since the last check.

Definition at line 1151 of file Gamepad.java.

◆ getTouchpadButtonReleased()

boolean org.wpilib.driverstation.Gamepad.getTouchpadButtonReleased ( )

Whether the Touchpad button was released since the last check.

Returns
Whether the button was released since the last check.

Definition at line 1160 of file Gamepad.java.

◆ getTouchpadFinger()

TouchpadFinger org.wpilib.driverstation.Gamepad.getTouchpadFinger ( int touchpad,
int finger )

Get the touchpad finger data.

Parameters
touchpadThe touchpad to read.
fingerThe finger to read.
Returns
The touchpad finger data.

Definition at line 1549 of file Gamepad.java.

◆ getTouchpadFingerAvailable()

boolean org.wpilib.driverstation.Gamepad.getTouchpadFingerAvailable ( int touchpad,
int finger )

Check if a touchpad finger is available.

Parameters
touchpadThe touchpad to check.
fingerThe finger to check.
Returns
true if the touchpad finger is available.

Definition at line 1538 of file Gamepad.java.

◆ guide()

BooleanEvent org.wpilib.driverstation.Gamepad.guide ( EventLoop loop)

Constructs an event instance around the Guide button's digital signal.

Parameters
loopthe event loop instance to attach the event to.
Returns
an event instance representing the Guide button's digital signal attached to the given loop.

Definition at line 601 of file Gamepad.java.

◆ isConnected()

boolean org.wpilib.driverstation.Gamepad.isConnected ( )

Get if the gamepad is connected.

Returns
true if the gamepad is connected

Definition at line 1477 of file Gamepad.java.

◆ leftBumper()

BooleanEvent org.wpilib.driverstation.Gamepad.leftBumper ( EventLoop loop)

Constructs an event instance around the right bumper button's digital signal.

Parameters
loopthe event loop instance to attach the event to.
Returns
an event instance representing the right bumper button's digital signal attached to the given loop.

Definition at line 753 of file Gamepad.java.

◆ leftPaddle1()

BooleanEvent org.wpilib.driverstation.Gamepad.leftPaddle1 ( EventLoop loop)

Constructs an event instance around the Left Paddle 1 button's digital signal.

Parameters
loopthe event loop instance to attach the event to.
Returns
an event instance representing the Left Paddle 1 button's digital signal attached to the given loop.

Definition at line 1057 of file Gamepad.java.

◆ leftPaddle2()

BooleanEvent org.wpilib.driverstation.Gamepad.leftPaddle2 ( EventLoop loop)

Constructs an event instance around the Left Paddle 2 button's digital signal.

Parameters
loopthe event loop instance to attach the event to.
Returns
an event instance representing the Left Paddle 2 button's digital signal attached to the given loop.

Definition at line 1133 of file Gamepad.java.

◆ leftStick()

BooleanEvent org.wpilib.driverstation.Gamepad.leftStick ( EventLoop loop)

Constructs an event instance around the left stick button's digital signal.

Parameters
loopthe event loop instance to attach the event to.
Returns
an event instance representing the left stick button's digital signal attached to the given loop.

Definition at line 677 of file Gamepad.java.

◆ leftTrigger() [1/2]

BooleanEvent org.wpilib.driverstation.Gamepad.leftTrigger ( double threshold,
EventLoop loop )

Constructs an event instance around the axis value of the left trigger. The returned trigger will be true when the axis value is greater than threshold.

Parameters
thresholdthe minimum axis value for the returned BooleanEvent to be true. This value should be in the range [0, 1] where 0 is the unpressed state of the axis.
loopthe event loop instance to attach the event to.
Returns
an event instance that is true when the left trigger's axis exceeds the provided threshold, attached to the given event loop

Definition at line 323 of file Gamepad.java.

◆ leftTrigger() [2/2]

BooleanEvent org.wpilib.driverstation.Gamepad.leftTrigger ( EventLoop loop)

Constructs an event instance around the axis value of the left trigger. The returned trigger will be true when the axis value is greater than 0.5.

Parameters
loopthe event loop instance to attach the event to.
Returns
an event instance that is true when the left trigger's axis exceeds the provided threshold, attached to the given event loop

Definition at line 335 of file Gamepad.java.

◆ logTo()

void org.wpilib.driverstation.Gamepad.logTo ( TelemetryTable table)

Logs the object to a TelemetryTable.

Parameters
tabletelemetry table

Implements org.wpilib.telemetry.TelemetryLoggable.

Definition at line 1558 of file Gamepad.java.

◆ misc1()

BooleanEvent org.wpilib.driverstation.Gamepad.misc1 ( EventLoop loop)

Constructs an event instance around the Miscellaneous 1 button's digital signal.

Parameters
loopthe event loop instance to attach the event to.
Returns
an event instance representing the Miscellaneous 1 button's digital signal attached to the given loop.

Definition at line 981 of file Gamepad.java.

◆ misc2()

BooleanEvent org.wpilib.driverstation.Gamepad.misc2 ( EventLoop loop)

Constructs an event instance around the Miscellaneous 2 button's digital signal.

Parameters
loopthe event loop instance to attach the event to.
Returns
an event instance representing the Miscellaneous 2 button's digital signal attached to the given loop.

Definition at line 1209 of file Gamepad.java.

◆ misc3()

BooleanEvent org.wpilib.driverstation.Gamepad.misc3 ( EventLoop loop)

Constructs an event instance around the Miscellaneous 3 button's digital signal.

Parameters
loopthe event loop instance to attach the event to.
Returns
an event instance representing the Miscellaneous 3 button's digital signal attached to the given loop.

Definition at line 1247 of file Gamepad.java.

◆ misc4()

BooleanEvent org.wpilib.driverstation.Gamepad.misc4 ( EventLoop loop)

Constructs an event instance around the Miscellaneous 4 button's digital signal.

Parameters
loopthe event loop instance to attach the event to.
Returns
an event instance representing the Miscellaneous 4 button's digital signal attached to the given loop.

Definition at line 1285 of file Gamepad.java.

◆ misc5()

BooleanEvent org.wpilib.driverstation.Gamepad.misc5 ( EventLoop loop)

Constructs an event instance around the Miscellaneous 5 button's digital signal.

Parameters
loopthe event loop instance to attach the event to.
Returns
an event instance representing the Miscellaneous 5 button's digital signal attached to the given loop.

Definition at line 1323 of file Gamepad.java.

◆ misc6()

BooleanEvent org.wpilib.driverstation.Gamepad.misc6 ( EventLoop loop)

Constructs an event instance around the Miscellaneous 6 button's digital signal.

Parameters
loopthe event loop instance to attach the event to.
Returns
an event instance representing the Miscellaneous 6 button's digital signal attached to the given loop.

Definition at line 1361 of file Gamepad.java.

◆ rightBumper()

BooleanEvent org.wpilib.driverstation.Gamepad.rightBumper ( EventLoop loop)

Constructs an event instance around the right bumper button's digital signal.

Parameters
loopthe event loop instance to attach the event to.
Returns
an event instance representing the right bumper button's digital signal attached to the given loop.

Definition at line 791 of file Gamepad.java.

◆ rightPaddle1()

BooleanEvent org.wpilib.driverstation.Gamepad.rightPaddle1 ( EventLoop loop)

Constructs an event instance around the Right Paddle 1 button's digital signal.

Parameters
loopthe event loop instance to attach the event to.
Returns
an event instance representing the Right Paddle 1 button's digital signal attached to the given loop.

Definition at line 1019 of file Gamepad.java.

◆ rightPaddle2()

BooleanEvent org.wpilib.driverstation.Gamepad.rightPaddle2 ( EventLoop loop)

Constructs an event instance around the Right Paddle 2 button's digital signal.

Parameters
loopthe event loop instance to attach the event to.
Returns
an event instance representing the Right Paddle 2 button's digital signal attached to the given loop.

Definition at line 1095 of file Gamepad.java.

◆ rightStick()

BooleanEvent org.wpilib.driverstation.Gamepad.rightStick ( EventLoop loop)

Constructs an event instance around the right stick button's digital signal.

Parameters
loopthe event loop instance to attach the event to.
Returns
an event instance representing the right stick button's digital signal attached to the given loop.

Definition at line 715 of file Gamepad.java.

◆ rightTrigger() [1/2]

BooleanEvent org.wpilib.driverstation.Gamepad.rightTrigger ( double threshold,
EventLoop loop )

Constructs an event instance around the axis value of the right trigger. The returned trigger will be true when the axis value is greater than threshold.

Parameters
thresholdthe minimum axis value for the returned BooleanEvent to be true. This value should be in the range [0, 1] where 0 is the unpressed state of the axis.
loopthe event loop instance to attach the event to.
Returns
an event instance that is true when the right trigger's axis exceeds the provided threshold, attached to the given event loop

Definition at line 361 of file Gamepad.java.

◆ rightTrigger() [2/2]

BooleanEvent org.wpilib.driverstation.Gamepad.rightTrigger ( EventLoop loop)

Constructs an event instance around the axis value of the right trigger. The returned trigger will be true when the axis value is greater than 0.5.

Parameters
loopthe event loop instance to attach the event to.
Returns
an event instance that is true when the right trigger's axis exceeds the provided threshold, attached to the given event loop

Definition at line 373 of file Gamepad.java.

◆ setLeds()

void org.wpilib.driverstation.Gamepad.setLeds ( int r,
int g,
int b )

Set leds on the gamepad. If only mono is supported, the system will use the highest value passed in.

Parameters
rRed value from 0-255
gGreen value from 0-255
bBlue value from 0-255

Definition at line 1516 of file Gamepad.java.

◆ setLeftTriggerDeadband()

void org.wpilib.driverstation.Gamepad.setLeftTriggerDeadband ( double deadband)

Set the deadband for the left trigger axis.

The deadband is clamped to [0, 1).

Parameters
deadbandThe deadband to apply.

Definition at line 242 of file Gamepad.java.

◆ setLeftXDeadband()

void org.wpilib.driverstation.Gamepad.setLeftXDeadband ( double deadband)

Set the deadband for the left X axis.

The deadband is clamped to [0, 1).

Parameters
deadbandThe deadband to apply.

Definition at line 198 of file Gamepad.java.

◆ setLeftYDeadband()

void org.wpilib.driverstation.Gamepad.setLeftYDeadband ( double deadband)

Set the deadband for the left Y axis.

The deadband is clamped to [0, 1).

Parameters
deadbandThe deadband to apply.

Definition at line 209 of file Gamepad.java.

◆ setRightTriggerDeadband()

void org.wpilib.driverstation.Gamepad.setRightTriggerDeadband ( double deadband)

Set the deadband for the right trigger axis.

The deadband is clamped to [0, 1).

Parameters
deadbandThe deadband to apply.

Definition at line 253 of file Gamepad.java.

◆ setRightXDeadband()

void org.wpilib.driverstation.Gamepad.setRightXDeadband ( double deadband)

Set the deadband for the right X axis.

The deadband is clamped to [0, 1).

Parameters
deadbandThe deadband to apply.

Definition at line 220 of file Gamepad.java.

◆ setRightYDeadband()

void org.wpilib.driverstation.Gamepad.setRightYDeadband ( double deadband)

Set the deadband for the right Y axis.

The deadband is clamped to [0, 1).

Parameters
deadbandThe deadband to apply.

Definition at line 231 of file Gamepad.java.

◆ setRumble()

void org.wpilib.driverstation.Gamepad.setRumble ( RumbleType type,
double value )

Set the rumble output for the HID. The DS currently supports 4 rumble values: left rumble, right rumble, left trigger rumble, and right trigger rumble.

Parameters
typeWhich rumble value to set
valueThe normalized value (0 to 1) to set the rumble to

Definition at line 1527 of file Gamepad.java.

◆ start()

BooleanEvent org.wpilib.driverstation.Gamepad.start ( EventLoop loop)

Constructs an event instance around the Start button's digital signal.

Parameters
loopthe event loop instance to attach the event to.
Returns
an event instance representing the Start button's digital signal attached to the given loop.

Definition at line 639 of file Gamepad.java.

◆ touchpad()

BooleanEvent org.wpilib.driverstation.Gamepad.touchpad ( EventLoop loop)

Constructs an event instance around the Touchpad button's digital signal.

Parameters
loopthe event loop instance to attach the event to.
Returns
an event instance representing the Touchpad button's digital signal attached to the given loop.

Definition at line 1171 of file Gamepad.java.


The documentation for this class was generated from the following file: