WPILibC++ 2023.4.3-108-ge5452e3
|
Class to control a simulated Xbox 360 or Xbox One controller. More...
#include <frc/simulation/XboxControllerSim.h>
Public Member Functions | |
XboxControllerSim (const XboxController &joystick) | |
Constructs from a XboxController object. More... | |
XboxControllerSim (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 | SetLeftTriggerAxis (double value) |
Change the left trigger axis value of the joystick. More... | |
void | SetRightTriggerAxis (double value) |
Change the right trigger axis value of the joystick. More... | |
void | SetLeftBumper (bool value) |
Change the left bumper value of the joystick. More... | |
void | SetRightBumper (bool value) |
Change the right bumper value of the joystick. More... | |
void | SetLeftStickButton (bool value) |
Change the left button value of the joystick. More... | |
void | SetRightStickButton (bool value) |
Change the right button value of the joystick. More... | |
void | SetAButton (bool value) |
Change the value of the A button. More... | |
void | SetBButton (bool value) |
Change the value of the B button. More... | |
void | SetXButton (bool value) |
Change the value of the X button. More... | |
void | SetYButton (bool value) |
Change the value of the Y button. More... | |
void | SetBackButton (bool value) |
Change the value of the Back button. More... | |
void | SetStartButton (bool value) |
Change the value of the Start button. 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 |
Class to control a simulated Xbox 360 or Xbox One controller.
|
explicit |
Constructs from a XboxController object.
joystick | controller to simulate |
|
explicit |
Constructs from a joystick port number.
port | port number |
void frc::sim::XboxControllerSim::SetAButton | ( | bool | value | ) |
Change the value of the A button.
value | the new value |
void frc::sim::XboxControllerSim::SetBackButton | ( | bool | value | ) |
Change the value of the Back button.
value | the new value |
void frc::sim::XboxControllerSim::SetBButton | ( | bool | value | ) |
Change the value of the B button.
value | the new value |
void frc::sim::XboxControllerSim::SetLeftBumper | ( | bool | value | ) |
Change the left bumper value of the joystick.
value | the new value |
void frc::sim::XboxControllerSim::SetLeftStickButton | ( | bool | value | ) |
Change the left button value of the joystick.
value | the new value |
void frc::sim::XboxControllerSim::SetLeftTriggerAxis | ( | double | value | ) |
Change the left trigger axis value of the joystick.
value | the new value |
void frc::sim::XboxControllerSim::SetLeftX | ( | double | value | ) |
Change the X axis value of the controller's left stick.
value | the new value |
void frc::sim::XboxControllerSim::SetLeftY | ( | double | value | ) |
Change the Y axis value of the controller's left stick.
value | the new value |
void frc::sim::XboxControllerSim::SetRightBumper | ( | bool | value | ) |
Change the right bumper value of the joystick.
value | the new value |
void frc::sim::XboxControllerSim::SetRightStickButton | ( | bool | value | ) |
Change the right button value of the joystick.
value | the new value |
void frc::sim::XboxControllerSim::SetRightTriggerAxis | ( | double | value | ) |
Change the right trigger axis value of the joystick.
value | the new value |
void frc::sim::XboxControllerSim::SetRightX | ( | double | value | ) |
Change the X axis value of the controller's right stick.
value | the new value |
void frc::sim::XboxControllerSim::SetRightY | ( | double | value | ) |
Change the Y axis value of the controller's right stick.
value | the new value |
void frc::sim::XboxControllerSim::SetStartButton | ( | bool | value | ) |
Change the value of the Start button.
value | the new value |
void frc::sim::XboxControllerSim::SetXButton | ( | bool | value | ) |
Change the value of the X button.
value | the new value |
void frc::sim::XboxControllerSim::SetYButton | ( | bool | value | ) |
Change the value of the Y button.
value | the new value |