WPILibC++ 2027.0.0-alpha-4
Loading...
Searching...
No Matches
wpi::sim::GamepadSim Class Reference

Class to control a simulated Gamepad controller. More...

#include <wpi/simulation/GamepadSim.hpp>

Inheritance diagram for wpi::sim::GamepadSim:
wpi::sim::GenericHIDSim

Public Member Functions

 GamepadSim (const Gamepad &joystick)
 Constructs from a Gamepad object.
 GamepadSim (int port)
 Constructs from a joystick port number.
void SetLeftX (double value)
 Change the left X value of the controller's joystick.
void SetLeftY (double value)
 Change the left Y value of the controller's joystick.
void SetRightX (double value)
 Change the right X value of the controller's joystick.
void SetRightY (double value)
 Change the right Y value of the controller's joystick.
void SetLeftTriggerAxis (double value)
 Change the value of the left trigger axis on the controller.
void SetRightTriggerAxis (double value)
 Change the value of the right trigger axis on the controller.
void SetSouthFaceButton (bool value)
 Change the value of the South Face button on the controller.
void SetEastFaceButton (bool value)
 Change the value of the East Face button on the controller.
void SetWestFaceButton (bool value)
 Change the value of the West Face button on the controller.
void SetNorthFaceButton (bool value)
 Change the value of the North Face button on the controller.
void SetBackButton (bool value)
 Change the value of the Back button on the controller.
void SetGuideButton (bool value)
 Change the value of the Guide button on the controller.
void SetStartButton (bool value)
 Change the value of the Start button on the controller.
void SetLeftStickButton (bool value)
 Change the value of the left stick button on the controller.
void SetRightStickButton (bool value)
 Change the value of the right stick button on the controller.
void SetLeftBumperButton (bool value)
 Change the value of the right bumper button on the controller.
void SetRightBumperButton (bool value)
 Change the value of the right bumper button on the controller.
void SetDpadUpButton (bool value)
 Change the value of the D-pad up button on the controller.
void SetDpadDownButton (bool value)
 Change the value of the D-pad down button on the controller.
void SetDpadLeftButton (bool value)
 Change the value of the D-pad left button on the controller.
void SetDpadRightButton (bool value)
 Change the value of the D-pad right button on the controller.
void SetMisc1Button (bool value)
 Change the value of the Miscellaneous 1 button on the controller.
void SetRightPaddle1Button (bool value)
 Change the value of the Right Paddle 1 button on the controller.
void SetLeftPaddle1Button (bool value)
 Change the value of the Left Paddle 1 button on the controller.
void SetRightPaddle2Button (bool value)
 Change the value of the Right Paddle 2 button on the controller.
void SetLeftPaddle2Button (bool value)
 Change the value of the Left Paddle 2 button on the controller.
void SetTouchpadButton (bool value)
 Change the value of the Touchpad button on the controller.
void SetMisc2Button (bool value)
 Change the value of the Miscellaneous 2 button on the controller.
void SetMisc3Button (bool value)
 Change the value of the Miscellaneous 3 button on the controller.
void SetMisc4Button (bool value)
 Change the value of the Miscellaneous 4 button on the controller.
void SetMisc5Button (bool value)
 Change the value of the Miscellaneous 5 button on the controller.
void SetMisc6Button (bool value)
 Change the value of the Miscellaneous 6 button on the controller.
Public Member Functions inherited from wpi::sim::GenericHIDSim
 GenericHIDSim (const GenericHID &joystick)
 Constructs from a GenericHID object.
 GenericHIDSim (int port)
 Constructs from a joystick port number.
void NotifyNewData ()
 Updates joystick data so that new values are visible to the user program.
void SetRawButton (int button, bool value)
 Set the value of a given button.
void SetRawAxis (int axis, double value)
 Set the value of a given axis.
void SetPOV (int pov, DriverStation::POVDirection value)
 Set the value of a given POV.
void SetPOV (DriverStation::POVDirection value)
 Set the value of the default POV (port 0).
void SetAxesMaximumIndex (int maximumIndex)
void SetAxesAvailable (int count)
 Set the axis count of this device.
void SetPOVsMaximumIndex (int maximumIndex)
void SetPOVsAvailable (int count)
 Set the POV count of this device.
void SetButtonsMaximumIndex (int maximumIndex)
void SetButtonsAvailable (uint64_t count)
 Set the button count of this device.
void SetGamepadType (GenericHID::HIDType type)
 Set the type of this device.
void SetSupportedOutputs (GenericHID::SupportedOutputs supportedOutputs)
void SetName (const char *name)
 Set the name of this device.
int32_t GetLeds ()
 Get the value of set LEDs.
double GetRumble (GenericHID::RumbleType type)
 Get the joystick rumble.

Additional Inherited Members

Protected Attributes inherited from wpi::sim::GenericHIDSim
int m_port
 GenericHID port.

Detailed Description

Class to control a simulated Gamepad controller.

Constructor & Destructor Documentation

◆ GamepadSim() [1/2]

wpi::sim::GamepadSim::GamepadSim ( const Gamepad & joystick)
explicit

Constructs from a Gamepad object.

Parameters
joystickcontroller to simulate

◆ GamepadSim() [2/2]

wpi::sim::GamepadSim::GamepadSim ( int port)
explicit

Constructs from a joystick port number.

Parameters
portport number

Member Function Documentation

◆ SetBackButton()

void wpi::sim::GamepadSim::SetBackButton ( bool value)

Change the value of the Back button on the controller.

Parameters
valuethe new value

◆ SetDpadDownButton()

void wpi::sim::GamepadSim::SetDpadDownButton ( bool value)

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

Parameters
valuethe new value

◆ SetDpadLeftButton()

void wpi::sim::GamepadSim::SetDpadLeftButton ( bool value)

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

Parameters
valuethe new value

◆ SetDpadRightButton()

void wpi::sim::GamepadSim::SetDpadRightButton ( bool value)

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

Parameters
valuethe new value

◆ SetDpadUpButton()

void wpi::sim::GamepadSim::SetDpadUpButton ( bool value)

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

Parameters
valuethe new value

◆ SetEastFaceButton()

void wpi::sim::GamepadSim::SetEastFaceButton ( bool value)

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

Parameters
valuethe new value

◆ SetGuideButton()

void wpi::sim::GamepadSim::SetGuideButton ( bool value)

Change the value of the Guide button on the controller.

Parameters
valuethe new value

◆ SetLeftBumperButton()

void wpi::sim::GamepadSim::SetLeftBumperButton ( bool value)

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

Parameters
valuethe new value

◆ SetLeftPaddle1Button()

void wpi::sim::GamepadSim::SetLeftPaddle1Button ( bool value)

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

Parameters
valuethe new value

◆ SetLeftPaddle2Button()

void wpi::sim::GamepadSim::SetLeftPaddle2Button ( bool value)

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

Parameters
valuethe new value

◆ SetLeftStickButton()

void wpi::sim::GamepadSim::SetLeftStickButton ( bool value)

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

Parameters
valuethe new value

◆ SetLeftTriggerAxis()

void wpi::sim::GamepadSim::SetLeftTriggerAxis ( double value)

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

Parameters
valuethe new value

◆ SetLeftX()

void wpi::sim::GamepadSim::SetLeftX ( double value)

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

Parameters
valuethe new value

◆ SetLeftY()

void wpi::sim::GamepadSim::SetLeftY ( double value)

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

Parameters
valuethe new value

◆ SetMisc1Button()

void wpi::sim::GamepadSim::SetMisc1Button ( bool value)

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

Parameters
valuethe new value

◆ SetMisc2Button()

void wpi::sim::GamepadSim::SetMisc2Button ( bool value)

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

Parameters
valuethe new value

◆ SetMisc3Button()

void wpi::sim::GamepadSim::SetMisc3Button ( bool value)

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

Parameters
valuethe new value

◆ SetMisc4Button()

void wpi::sim::GamepadSim::SetMisc4Button ( bool value)

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

Parameters
valuethe new value

◆ SetMisc5Button()

void wpi::sim::GamepadSim::SetMisc5Button ( bool value)

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

Parameters
valuethe new value

◆ SetMisc6Button()

void wpi::sim::GamepadSim::SetMisc6Button ( bool value)

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

Parameters
valuethe new value

◆ SetNorthFaceButton()

void wpi::sim::GamepadSim::SetNorthFaceButton ( bool value)

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

Parameters
valuethe new value

◆ SetRightBumperButton()

void wpi::sim::GamepadSim::SetRightBumperButton ( bool value)

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

Parameters
valuethe new value

◆ SetRightPaddle1Button()

void wpi::sim::GamepadSim::SetRightPaddle1Button ( bool value)

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

Parameters
valuethe new value

◆ SetRightPaddle2Button()

void wpi::sim::GamepadSim::SetRightPaddle2Button ( bool value)

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

Parameters
valuethe new value

◆ SetRightStickButton()

void wpi::sim::GamepadSim::SetRightStickButton ( bool value)

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

Parameters
valuethe new value

◆ SetRightTriggerAxis()

void wpi::sim::GamepadSim::SetRightTriggerAxis ( double value)

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

Parameters
valuethe new value

◆ SetRightX()

void wpi::sim::GamepadSim::SetRightX ( double value)

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

Parameters
valuethe new value

◆ SetRightY()

void wpi::sim::GamepadSim::SetRightY ( double value)

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

Parameters
valuethe new value

◆ SetSouthFaceButton()

void wpi::sim::GamepadSim::SetSouthFaceButton ( bool value)

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

Parameters
valuethe new value

◆ SetStartButton()

void wpi::sim::GamepadSim::SetStartButton ( bool value)

Change the value of the Start button on the controller.

Parameters
valuethe new value

◆ SetTouchpadButton()

void wpi::sim::GamepadSim::SetTouchpadButton ( bool value)

Change the value of the Touchpad button on the controller.

Parameters
valuethe new value

◆ SetWestFaceButton()

void wpi::sim::GamepadSim::SetWestFaceButton ( bool value)

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

Parameters
valuethe new value

The documentation for this class was generated from the following file: