PS4ControllerSim

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

Bases: wpilib.simulation._simulation.GenericHIDSim

Class to control a simulated PS4 controller.

Overloaded function.

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

Constructs from a PS4Controller object.

Parameters

joystick – controller to simulate

  1. __init__(self: wpilib.simulation._simulation.PS4ControllerSim, port: int) -> None

Constructs from a joystick port number.

Parameters

port – port number

setCircleButton(value: bool) None

Change the value of the Circle button on the controller.

Parameters

value – the new value

setCrossButton(value: bool) None

Change the value of the Cross button on the controller.

Parameters

value – the new value

setL1Button(value: bool) None

Change the value of the L1 button on the controller.

Parameters

value – the new value

setL2Axis(value: float) None

Change the L2 axis axis value of the controller.

Parameters

value – the new value

setL2Button(value: bool) None

Change the value of the L2 button on the controller.

Parameters

value – the new value

setL3Button(value: bool) None

Change the value of the L3 (left stick) button on the controller.

Parameters

value – the new value

setLeftX(value: float) None

Change the X axis value of the controller’s left stick.

Parameters

value – the new value

setLeftY(value: float) None

Change the Y axis value of the controller’s left stick.

Parameters

value – the new value

setOptionsButton(value: bool) None

Change the value of the Options button on the controller.

Parameters

value – the new value

setPSButton(value: bool) None

Change the value of the PS button on the controller.

Parameters

value – the new value

setR1Button(value: bool) None

Change the value of the R1 button on the controller.

Parameters

value – the new value

setR2Axis(value: float) None

Change the R2 axis value of the controller.

Parameters

value – the new value

setR2Button(value: bool) None

Change the value of the R2 button on the controller.

Parameters

value – the new value

setR3Button(value: bool) None

Change the value of the R3 (right stick) button on the controller.

Parameters

value – the new value

setRightX(value: float) None

Change the X axis value of the controller’s right stick.

Parameters

value – the new value

setRightY(value: float) None

Change the Y axis value of the controller’s right stick.

Parameters

value – the new value

setShareButton(value: bool) None

Change the value of the Share button on the controller.

Parameters

value – the new value

setSquareButton(value: bool) None

Change the value of the Square button on the controller.

Parameters

value – the new value

setTouchpad(value: bool) None

Change the value of the touchpad button on the controller.

Parameters

value – the new value

setTriangleButton(value: bool) None

Change the value of the Triangle button on the controller.

Parameters

value – the new value