WPILibC++ 2024.3.2
|
Class to control a simulated PS4 controller. More...
#include <frc/simulation/PS4ControllerSim.h>
Public Member Functions | |
PS4ControllerSim (const PS4Controller &joystick) | |
Constructs from a PS4Controller object. More... | |
PS4ControllerSim (int port) | |
Constructs from a joystick port number. More... | |
void | SetLeftX (double value) |
Change the X axis value of the controller's left stick. More... | |
void | SetRightX (double value) |
Change the X axis value of the controller's right stick. More... | |
void | SetLeftY (double value) |
Change the Y axis value of the controller's left stick. More... | |
void | SetRightY (double value) |
Change the Y axis value of the controller's right stick. More... | |
void | SetL2Axis (double value) |
Change the L2 axis axis value of the controller. More... | |
void | SetR2Axis (double value) |
Change the R2 axis value of the controller. More... | |
void | SetSquareButton (bool value) |
Change the value of the Square button on the controller. More... | |
void | SetCrossButton (bool value) |
Change the value of the Cross button on the controller. More... | |
void | SetCircleButton (bool value) |
Change the value of the Circle button on the controller. More... | |
void | SetTriangleButton (bool value) |
Change the value of the Triangle button on the controller. More... | |
void | SetL1Button (bool value) |
Change the value of the L1 button on the controller. More... | |
void | SetR1Button (bool value) |
Change the value of the R1 button on the controller. More... | |
void | SetL2Button (bool value) |
Change the value of the L2 button on the controller. More... | |
void | SetR2Button (bool value) |
Change the value of the R2 button on the controller. More... | |
void | SetShareButton (bool value) |
Change the value of the Share button on the controller. More... | |
void | SetOptionsButton (bool value) |
Change the value of the Options button on the controller. More... | |
void | SetL3Button (bool value) |
Change the value of the L3 (left stick) button on the controller. More... | |
void | SetR3Button (bool value) |
Change the value of the R3 (right stick) button on the controller. More... | |
void | SetPSButton (bool value) |
Change the value of the PS button on the controller. More... | |
void | SetTouchpad (bool value) |
Change the value of the touchpad button on the controller. More... | |
Public Member Functions inherited from frc::sim::GenericHIDSim | |
GenericHIDSim (const GenericHID &joystick) | |
Constructs from a GenericHID object. More... | |
GenericHIDSim (int port) | |
Constructs from a joystick port number. More... | |
void | NotifyNewData () |
Updates joystick data so that new values are visible to the user program. More... | |
void | SetRawButton (int button, bool value) |
Set the value of a given button. More... | |
void | SetRawAxis (int axis, double value) |
Set the value of a given axis. More... | |
void | SetPOV (int pov, int value) |
Set the value of a given POV. More... | |
void | SetPOV (int value) |
Set the value of the default POV (port 0). More... | |
void | SetAxisCount (int count) |
Set the axis count of this device. More... | |
void | SetPOVCount (int count) |
Set the POV count of this device. More... | |
void | SetButtonCount (int count) |
Set the button count of this device. More... | |
void | SetType (GenericHID::HIDType type) |
Set the type of this device. More... | |
void | SetName (const char *name) |
Set the name of this device. More... | |
void | SetAxisType (int axis, int type) |
Set the type of an axis. More... | |
bool | GetOutput (int outputNumber) |
Read the output of a button. More... | |
int64_t | GetOutputs () |
Get the encoded 16-bit integer that passes button values. More... | |
double | GetRumble (GenericHID::RumbleType type) |
Get the joystick rumble. More... | |
Additional Inherited Members | |
Protected Attributes inherited from frc::sim::GenericHIDSim | |
int | m_port |
GenericHID port. More... | |
Class to control a simulated PS4 controller.
|
explicit |
Constructs from a PS4Controller object.
joystick | controller to simulate |
|
explicit |
Constructs from a joystick port number.
port | port number |
void frc::sim::PS4ControllerSim::SetCircleButton | ( | bool | value | ) |
Change the value of the Circle button on the controller.
value | the new value |
void frc::sim::PS4ControllerSim::SetCrossButton | ( | bool | value | ) |
Change the value of the Cross button on the controller.
value | the new value |
void frc::sim::PS4ControllerSim::SetL1Button | ( | bool | value | ) |
Change the value of the L1 button on the controller.
value | the new value |
void frc::sim::PS4ControllerSim::SetL2Axis | ( | double | value | ) |
Change the L2 axis axis value of the controller.
value | the new value |
void frc::sim::PS4ControllerSim::SetL2Button | ( | bool | value | ) |
Change the value of the L2 button on the controller.
value | the new value |
void frc::sim::PS4ControllerSim::SetL3Button | ( | bool | value | ) |
Change the value of the L3 (left stick) button on the controller.
value | the new value |
void frc::sim::PS4ControllerSim::SetLeftX | ( | double | value | ) |
Change the X axis value of the controller's left stick.
value | the new value |
void frc::sim::PS4ControllerSim::SetLeftY | ( | double | value | ) |
Change the Y axis value of the controller's left stick.
value | the new value |
void frc::sim::PS4ControllerSim::SetOptionsButton | ( | bool | value | ) |
Change the value of the Options button on the controller.
value | the new value |
void frc::sim::PS4ControllerSim::SetPSButton | ( | bool | value | ) |
Change the value of the PS button on the controller.
value | the new value |
void frc::sim::PS4ControllerSim::SetR1Button | ( | bool | value | ) |
Change the value of the R1 button on the controller.
value | the new value |
void frc::sim::PS4ControllerSim::SetR2Axis | ( | double | value | ) |
Change the R2 axis value of the controller.
value | the new value |
void frc::sim::PS4ControllerSim::SetR2Button | ( | bool | value | ) |
Change the value of the R2 button on the controller.
value | the new value |
void frc::sim::PS4ControllerSim::SetR3Button | ( | bool | value | ) |
Change the value of the R3 (right stick) button on the controller.
value | the new value |
void frc::sim::PS4ControllerSim::SetRightX | ( | double | value | ) |
Change the X axis value of the controller's right stick.
value | the new value |
void frc::sim::PS4ControllerSim::SetRightY | ( | double | value | ) |
Change the Y axis value of the controller's right stick.
value | the new value |
void frc::sim::PS4ControllerSim::SetShareButton | ( | bool | value | ) |
Change the value of the Share button on the controller.
value | the new value |
void frc::sim::PS4ControllerSim::SetSquareButton | ( | bool | value | ) |
Change the value of the Square button on the controller.
value | the new value |
void frc::sim::PS4ControllerSim::SetTouchpad | ( | bool | value | ) |
Change the value of the touchpad button on the controller.
value | the new value |
void frc::sim::PS4ControllerSim::SetTriangleButton | ( | bool | value | ) |
Change the value of the Triangle button on the controller.
value | the new value |