GamepadSim

class wpilib.simulation.GamepadSim(*args, **kwargs)

Bases: GenericHIDSim

Class to control a simulated Gamepad controller.

Overloaded function.

  1. __init__(self: wpilib.simulation._simulation.GamepadSim, joystick: wpilib._wpilib.Gamepad) -> None

Constructs from a Gamepad object.

Parameters:

joystick – controller to simulate

  1. __init__(self: wpilib.simulation._simulation.GamepadSim, port: typing.SupportsInt | typing.SupportsIndex) -> None

Constructs from a joystick port number.

Parameters:

port – port number

setAxis(axis: wpilib._wpilib.Gamepad.Axis, value: SupportsFloat | SupportsIndex) None

Set the value of a given axis.

Parameters:
  • axis – the axis to set

  • value – the new value

setBackButton(value: bool) None

Change the value of the Back button on the controller.

Parameters:

value – the new value

setButton(button: wpilib._wpilib.Gamepad.Button, value: bool) None

Set the value of a given button.

Parameters:
  • button – the button to set

  • value – the new value

setDpadDownButton(value: bool) None

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

Parameters:

value – the new value

setDpadLeftButton(value: bool) None

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

Parameters:

value – the new value

setDpadRightButton(value: bool) None

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

Parameters:

value – the new value

setDpadUpButton(value: bool) None

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

Parameters:

value – the new value

setEastFaceButton(value: bool) None

Change the value of the East Face button on the controller.

Parameters:

value – the new value

setGuideButton(value: bool) None

Change the value of the Guide button on the controller.

Parameters:

value – the new value

setLeftBumperButton(value: bool) None

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

Parameters:

value – the new value

setLeftPaddle1Button(value: bool) None

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

Parameters:

value – the new value

setLeftPaddle2Button(value: bool) None

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

Parameters:

value – the new value

setLeftStickButton(value: bool) None

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

Parameters:

value – the new value

setLeftTriggerAxis(value: SupportsFloat | SupportsIndex) None

Change the value of the left trigger axis on the controller.

Parameters:

value – the new value

setLeftX(value: SupportsFloat | SupportsIndex) None

Change the left X value of the controller’s joystick.

Parameters:

value – the new value

setLeftY(value: SupportsFloat | SupportsIndex) None

Change the left Y value of the controller’s joystick.

Parameters:

value – the new value

setMisc1Button(value: bool) None

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

Parameters:

value – the new value

setMisc2Button(value: bool) None

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

Parameters:

value – the new value

setMisc3Button(value: bool) None

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

Parameters:

value – the new value

setMisc4Button(value: bool) None

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

Parameters:

value – the new value

setMisc5Button(value: bool) None

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

Parameters:

value – the new value

setMisc6Button(value: bool) None

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

Parameters:

value – the new value

setNorthFaceButton(value: bool) None

Change the value of the North Face button on the controller.

Parameters:

value – the new value

setRightBumperButton(value: bool) None

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

Parameters:

value – the new value

setRightPaddle1Button(value: bool) None

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

Parameters:

value – the new value

setRightPaddle2Button(value: bool) None

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

Parameters:

value – the new value

setRightStickButton(value: bool) None

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

Parameters:

value – the new value

setRightTriggerAxis(value: SupportsFloat | SupportsIndex) None

Change the value of the right trigger axis on the controller.

Parameters:

value – the new value

setRightX(value: SupportsFloat | SupportsIndex) None

Change the right X value of the controller’s joystick.

Parameters:

value – the new value

setRightY(value: SupportsFloat | SupportsIndex) None

Change the right Y value of the controller’s joystick.

Parameters:

value – the new value

setSouthFaceButton(value: bool) None

Change the value of the South Face button on the controller.

Parameters:

value – the new value

setStartButton(value: bool) None

Change the value of the Start button on the controller.

Parameters:

value – the new value

setTouchpadButton(value: bool) None

Change the value of the Touchpad button on the controller.

Parameters:

value – the new value

setWestFaceButton(value: bool) None

Change the value of the West Face button on the controller.

Parameters:

value – the new value