Package edu.wpi.first.wpilibj.simulation
Class PS4ControllerSim
- java.lang.Object
-
- edu.wpi.first.wpilibj.simulation.GenericHIDSim
-
- edu.wpi.first.wpilibj.simulation.PS4ControllerSim
-
public class PS4ControllerSim extends GenericHIDSim
Class to control a simulated PS4 controller.
-
-
Field Summary
-
Fields inherited from class edu.wpi.first.wpilibj.simulation.GenericHIDSim
m_port
-
-
Constructor Summary
Constructors Constructor Description PS4ControllerSim(int port)
Constructs from a joystick port number.PS4ControllerSim(PS4Controller joystick)
Constructs from a PS4Controller object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
setCircleButton(boolean value)
Change the value of the Circle button on the controller.void
setCrossButton(boolean value)
Change the value of the Cross button on the controller.void
setL1Button(boolean value)
Change the value of the L1 button on the controller.void
setL2Axis(double value)
Change the L2 axis axis value of the controller.void
setL2Button(boolean value)
Change the value of the L2 button on the controller.void
setL3Button(boolean value)
Change the value of the L3 (left stick) button on the controller.void
setLeftX(double value)
Change the X axis value of the controller's left stick.void
setLeftY(double value)
Change the Y axis value of the controller's left stick.void
setOptionsButton(boolean value)
Change the value of the Options button on the controller.void
setPSButton(boolean value)
Change the value of the PS button on the controller.void
setR1Button(boolean value)
Change the value of the R1 button on the controller.void
setR2Axis(double value)
Change the R2 axis value of the controller.void
setR2Button(boolean value)
Change the value of the R2 button on the controller.void
setR3Button(boolean value)
Change the value of the R3 (right stick) button on the controller.void
setRightX(double value)
Change the X axis value of the controller's right stick.void
setRightY(double value)
Change the Y axis value of the controller's right stick.void
setShareButton(boolean value)
Change the value of the Share button on the controller.void
setSquareButton(boolean value)
Change the value of the Square button on the controller.void
setTouchpad(boolean value)
Change the value of the touchpad button on the controller.void
setTriangleButton(boolean value)
Change the value of the Triangle button on the controller.-
Methods inherited from class edu.wpi.first.wpilibj.simulation.GenericHIDSim
getOutput, getOutputs, getRumble, notifyNewData, setAxisCount, setAxisType, setButtonCount, setName, setPOV, setPOV, setPOVCount, setRawAxis, setRawButton, setType
-
-
-
-
Constructor Detail
-
PS4ControllerSim
public PS4ControllerSim(PS4Controller joystick)
Constructs from a PS4Controller object.- Parameters:
joystick
- controller to simulate
-
PS4ControllerSim
public PS4ControllerSim(int port)
Constructs from a joystick port number.- Parameters:
port
- port number
-
-
Method Detail
-
setLeftX
public void setLeftX(double value)
Change the X axis value of the controller's left stick.- Parameters:
value
- the new value
-
setRightX
public void setRightX(double value)
Change the X axis value of the controller's right stick.- Parameters:
value
- the new value
-
setLeftY
public void setLeftY(double value)
Change the Y axis value of the controller's left stick.- Parameters:
value
- the new value
-
setRightY
public void setRightY(double value)
Change the Y axis value of the controller's right stick.- Parameters:
value
- the new value
-
setL2Axis
public void setL2Axis(double value)
Change the L2 axis axis value of the controller.- Parameters:
value
- the new value
-
setR2Axis
public void setR2Axis(double value)
Change the R2 axis value of the controller.- Parameters:
value
- the new value
-
setSquareButton
public void setSquareButton(boolean value)
Change the value of the Square button on the controller.- Parameters:
value
- the new value
-
setCrossButton
public void setCrossButton(boolean value)
Change the value of the Cross button on the controller.- Parameters:
value
- the new value
-
setCircleButton
public void setCircleButton(boolean value)
Change the value of the Circle button on the controller.- Parameters:
value
- the new value
-
setTriangleButton
public void setTriangleButton(boolean value)
Change the value of the Triangle button on the controller.- Parameters:
value
- the new value
-
setL1Button
public void setL1Button(boolean value)
Change the value of the L1 button on the controller.- Parameters:
value
- the new value
-
setR1Button
public void setR1Button(boolean value)
Change the value of the R1 button on the controller.- Parameters:
value
- the new value
-
setL2Button
public void setL2Button(boolean value)
Change the value of the L2 button on the controller.- Parameters:
value
- the new value
-
setR2Button
public void setR2Button(boolean value)
Change the value of the R2 button on the controller.- Parameters:
value
- the new value
-
setShareButton
public void setShareButton(boolean value)
Change the value of the Share button on the controller.- Parameters:
value
- the new value
-
setOptionsButton
public void setOptionsButton(boolean value)
Change the value of the Options button on the controller.- Parameters:
value
- the new value
-
setL3Button
public void setL3Button(boolean value)
Change the value of the L3 (left stick) button on the controller.- Parameters:
value
- the new value
-
setR3Button
public void setR3Button(boolean value)
Change the value of the R3 (right stick) button on the controller.- Parameters:
value
- the new value
-
setPSButton
public void setPSButton(boolean value)
Change the value of the PS button on the controller.- Parameters:
value
- the new value
-
setTouchpad
public void setTouchpad(boolean value)
Change the value of the touchpad button on the controller.- Parameters:
value
- the new value
-
-