WPILibC++ 2025.2.1
Loading...
Searching...
No Matches
frc::PS4Controller Class Reference

Handle input from PS4 controllers connected to the Driver Station. More...

#include <frc/PS4Controller.h>

Inheritance diagram for frc::PS4Controller:
frc::GenericHID wpi::Sendable wpi::SendableHelper< PS4Controller >

Classes

struct  Axis
 Represents an axis on an PS4Controller. More...
 
struct  Button
 Represents a digital button on an PS4Controller. More...
 

Public Member Functions

 PS4Controller (int port)
 Construct an instance of a controller.
 
 ~PS4Controller () override=default
 
 PS4Controller (PS4Controller &&)=default
 
PS4Controlleroperator= (PS4Controller &&)=default
 
double GetLeftX () const
 Get the X axis value of left side of the controller.
 
double GetLeftY () const
 Get the Y axis value of left side of the controller.
 
double GetRightX () const
 Get the X axis value of right side of the controller.
 
double GetRightY () const
 Get the Y axis value of right side of the controller.
 
double GetL2Axis () const
 Get the left trigger 2 axis value of the controller.
 
double GetR2Axis () const
 Get the right trigger 2 axis value of the controller.
 
bool GetSquareButton () const
 Read the value of the square button on the controller.
 
bool GetSquareButtonPressed ()
 Whether the square button was pressed since the last check.
 
bool GetSquareButtonReleased ()
 Whether the square button was released since the last check.
 
BooleanEvent Square (EventLoop *loop) const
 Constructs an event instance around the square button's digital signal.
 
bool GetCrossButton () const
 Read the value of the cross button on the controller.
 
bool GetCrossButtonPressed ()
 Whether the cross button was pressed since the last check.
 
bool GetCrossButtonReleased ()
 Whether the cross button was released since the last check.
 
BooleanEvent Cross (EventLoop *loop) const
 Constructs an event instance around the cross button's digital signal.
 
bool GetCircleButton () const
 Read the value of the circle button on the controller.
 
bool GetCircleButtonPressed ()
 Whether the circle button was pressed since the last check.
 
bool GetCircleButtonReleased ()
 Whether the circle button was released since the last check.
 
BooleanEvent Circle (EventLoop *loop) const
 Constructs an event instance around the circle button's digital signal.
 
bool GetTriangleButton () const
 Read the value of the triangle button on the controller.
 
bool GetTriangleButtonPressed ()
 Whether the triangle button was pressed since the last check.
 
bool GetTriangleButtonReleased ()
 Whether the triangle button was released since the last check.
 
BooleanEvent Triangle (EventLoop *loop) const
 Constructs an event instance around the triangle button's digital signal.
 
bool GetL1Button () const
 Read the value of the left trigger 1 button on the controller.
 
bool GetL1ButtonPressed ()
 Whether the left trigger 1 button was pressed since the last check.
 
bool GetL1ButtonReleased ()
 Whether the left trigger 1 button was released since the last check.
 
BooleanEvent L1 (EventLoop *loop) const
 Constructs an event instance around the left trigger 1 button's digital signal.
 
bool GetR1Button () const
 Read the value of the right trigger 1 button on the controller.
 
bool GetR1ButtonPressed ()
 Whether the right trigger 1 button was pressed since the last check.
 
bool GetR1ButtonReleased ()
 Whether the right trigger 1 button was released since the last check.
 
BooleanEvent R1 (EventLoop *loop) const
 Constructs an event instance around the right trigger 1 button's digital signal.
 
bool GetL2Button () const
 Read the value of the left trigger 2 button on the controller.
 
bool GetL2ButtonPressed ()
 Whether the left trigger 2 button was pressed since the last check.
 
bool GetL2ButtonReleased ()
 Whether the left trigger 2 button was released since the last check.
 
BooleanEvent L2 (EventLoop *loop) const
 Constructs an event instance around the left trigger 2 button's digital signal.
 
bool GetR2Button () const
 Read the value of the right trigger 2 button on the controller.
 
bool GetR2ButtonPressed ()
 Whether the right trigger 2 button was pressed since the last check.
 
bool GetR2ButtonReleased ()
 Whether the right trigger 2 button was released since the last check.
 
BooleanEvent R2 (EventLoop *loop) const
 Constructs an event instance around the right trigger 2 button's digital signal.
 
bool GetShareButton () const
 Read the value of the share button on the controller.
 
bool GetShareButtonPressed ()
 Whether the share button was pressed since the last check.
 
bool GetShareButtonReleased ()
 Whether the share button was released since the last check.
 
BooleanEvent Share (EventLoop *loop) const
 Constructs an event instance around the share button's digital signal.
 
bool GetOptionsButton () const
 Read the value of the options button on the controller.
 
bool GetOptionsButtonPressed ()
 Whether the options button was pressed since the last check.
 
bool GetOptionsButtonReleased ()
 Whether the options button was released since the last check.
 
BooleanEvent Options (EventLoop *loop) const
 Constructs an event instance around the options button's digital signal.
 
bool GetL3Button () const
 Read the value of the L3 (left stick) button on the controller.
 
bool GetL3ButtonPressed ()
 Whether the L3 (left stick) button was pressed since the last check.
 
bool GetL3ButtonReleased ()
 Whether the L3 (left stick) button was released since the last check.
 
BooleanEvent L3 (EventLoop *loop) const
 Constructs an event instance around the L3 (left stick) button's digital signal.
 
bool GetR3Button () const
 Read the value of the R3 (right stick) button on the controller.
 
bool GetR3ButtonPressed ()
 Whether the R3 (right stick) button was pressed since the last check.
 
bool GetR3ButtonReleased ()
 Whether the R3 (right stick) button was released since the last check.
 
BooleanEvent R3 (EventLoop *loop) const
 Constructs an event instance around the R3 (right stick) button's digital signal.
 
bool GetPSButton () const
 Read the value of the PlayStation button on the controller.
 
bool GetPSButtonPressed ()
 Whether the PlayStation button was pressed since the last check.
 
bool GetPSButtonReleased ()
 Whether the PlayStation button was released since the last check.
 
BooleanEvent PS (EventLoop *loop) const
 Constructs an event instance around the PlayStation button's digital signal.
 
bool GetTouchpadButton () const
 Read the value of the touchpad button on the controller.
 
bool GetTouchpadButtonPressed ()
 Whether the touchpad button was pressed since the last check.
 
bool GetTouchpadButtonReleased ()
 Whether the touchpad button was released since the last check.
 
BooleanEvent Touchpad (EventLoop *loop) const
 Constructs an event instance around the touchpad button's digital signal.
 
bool GetTouchpad () const
 Read the value of the touchpad button on the controller.
 
bool GetTouchpadPressed ()
 Whether the touchpad was pressed since the last check.
 
bool GetTouchpadReleased ()
 Whether the touchpad was released since the last check.
 
void InitSendable (wpi::SendableBuilder &builder) override
 Initializes this Sendable object.
 
- Public Member Functions inherited from frc::GenericHID
 GenericHID (int port)
 
virtual ~GenericHID ()=default
 
 GenericHID (GenericHID &&)=default
 
GenericHIDoperator= (GenericHID &&)=default
 
bool GetRawButton (int button) const
 Get the button value (starting at button 1).
 
bool GetRawButtonPressed (int button)
 Whether the button was pressed since the last check.
 
bool GetRawButtonReleased (int button)
 Whether the button was released since the last check.
 
BooleanEvent Button (int button, EventLoop *loop) const
 Constructs an event instance around this button's digital signal.
 
double GetRawAxis (int axis) const
 Get the value of the axis.
 
int GetPOV (int pov=0) const
 Get the angle in degrees of a POV on the HID.
 
BooleanEvent POV (int angle, EventLoop *loop) const
 Constructs a BooleanEvent instance based around this angle of a POV on the HID.
 
BooleanEvent POV (int pov, int angle, EventLoop *loop) const
 Constructs a BooleanEvent instance based around this angle of a POV on the HID.
 
BooleanEvent POVUp (EventLoop *loop) const
 Constructs a BooleanEvent instance based around the 0 degree angle (up) of the default (index 0) POV on the HID.
 
BooleanEvent POVUpRight (EventLoop *loop) const
 Constructs a BooleanEvent instance based around the 45 degree angle (right up) of the default (index 0) POV on the HID.
 
BooleanEvent POVRight (EventLoop *loop) const
 Constructs a BooleanEvent instance based around the 90 degree angle (right) of the default (index 0) POV on the HID.
 
BooleanEvent POVDownRight (EventLoop *loop) const
 Constructs a BooleanEvent instance based around the 135 degree angle (right down) of the default (index 0) POV on the HID.
 
BooleanEvent POVDown (EventLoop *loop) const
 Constructs a BooleanEvent instance based around the 180 degree angle (down) of the default (index 0) POV on the HID.
 
BooleanEvent POVDownLeft (EventLoop *loop) const
 Constructs a BooleanEvent instance based around the 225 degree angle (down left) of the default (index 0) POV on the HID.
 
BooleanEvent POVLeft (EventLoop *loop) const
 Constructs a BooleanEvent instance based around the 270 degree angle (left) of the default (index 0) POV on the HID.
 
BooleanEvent POVUpLeft (EventLoop *loop) const
 Constructs a BooleanEvent instance based around the 315 degree angle (left up) of the default (index 0) POV on the HID.
 
BooleanEvent POVCenter (EventLoop *loop) const
 Constructs a BooleanEvent instance based around the center (not pressed) of the default (index 0) POV on the HID.
 
BooleanEvent AxisLessThan (int axis, double threshold, EventLoop *loop) const
 Constructs an event instance that is true when the axis value is less than threshold.
 
BooleanEvent AxisGreaterThan (int axis, double threshold, EventLoop *loop) const
 Constructs an event instance that is true when the axis value is greater than threshold.
 
int GetAxisCount () const
 Get the number of axes for the HID.
 
int GetPOVCount () const
 Get the number of POVs for the HID.
 
int GetButtonCount () const
 Get the number of buttons for the HID.
 
bool IsConnected () const
 Get if the HID is connected.
 
GenericHID::HIDType GetType () const
 Get the type of the HID.
 
std::string GetName () const
 Get the name of the HID.
 
int GetAxisType (int axis) const
 Get the axis type of a joystick axis.
 
int GetPort () const
 Get the port number of the HID.
 
void SetOutput (int outputNumber, bool value)
 Set a single HID output value for the HID.
 
void SetOutputs (int value)
 Set all output values for the HID.
 
void SetRumble (RumbleType type, double value)
 Set the rumble output for the HID.
 
- Public Member Functions inherited from wpi::Sendable
virtual constexpr ~Sendable ()=default
 
- Public Member Functions inherited from wpi::SendableHelper< PS4Controller >
constexpr SendableHelper (const SendableHelper &rhs)=default
 
constexpr SendableHelper (SendableHelper &&rhs)
 
constexpr SendableHelperoperator= (const SendableHelper &rhs)=default
 
constexpr SendableHelperoperator= (SendableHelper &&rhs)
 

Additional Inherited Members

- Public Types inherited from frc::GenericHID
enum  RumbleType { kLeftRumble , kRightRumble , kBothRumble }
 Represents a rumble output on the Joystick. More...
 
enum  HIDType {
  kUnknown = -1 , kXInputUnknown = 0 , kXInputGamepad = 1 , kXInputWheel = 2 ,
  kXInputArcadeStick = 3 , kXInputFlightStick = 4 , kXInputDancePad = 5 , kXInputGuitar = 6 ,
  kXInputGuitar2 = 7 , kXInputDrumKit = 8 , kXInputGuitar3 = 11 , kXInputArcadePad = 19 ,
  kHIDJoystick = 20 , kHIDGamepad = 21 , kHIDDriving = 22 , kHIDFlight = 23 ,
  kHID1stPerson = 24
}
 USB HID interface type. More...
 
- Protected Member Functions inherited from wpi::SendableHelper< PS4Controller >
constexpr SendableHelper ()=default
 
constexpr ~SendableHelper ()
 

Detailed Description

Handle input from PS4 controllers connected to the Driver Station.

This class handles PS4 input that comes from the Driver Station. Each time a value is requested the most recent value is returned. There is a single class instance for each controller and the mapping of ports to hardware buttons depends on the code in the Driver Station.

Only first party controllers from Sony are guaranteed to have the correct mapping, and only through the official NI DS. Sim is not guaranteed to have the same mapping, as well as any 3rd party controllers.

Constructor & Destructor Documentation

◆ PS4Controller() [1/2]

frc::PS4Controller::PS4Controller ( int port)
explicit

Construct an instance of a controller.

The controller index is the USB port on the Driver Station.

Parameters
portThe port on the Driver Station that the controller is plugged into (0-5).

◆ ~PS4Controller()

frc::PS4Controller::~PS4Controller ( )
overridedefault

◆ PS4Controller() [2/2]

frc::PS4Controller::PS4Controller ( PS4Controller && )
default

Member Function Documentation

◆ Circle()

BooleanEvent frc::PS4Controller::Circle ( EventLoop * loop) const

Constructs an event instance around the circle button's digital signal.

Parameters
loopthe event loop instance to attach the event to.
Returns
an event instance representing the circle button's digital signal attached to the given loop.

◆ Cross()

BooleanEvent frc::PS4Controller::Cross ( EventLoop * loop) const

Constructs an event instance around the cross button's digital signal.

Parameters
loopthe event loop instance to attach the event to.
Returns
an event instance representing the cross button's digital signal attached to the given loop.

◆ GetCircleButton()

bool frc::PS4Controller::GetCircleButton ( ) const

Read the value of the circle button on the controller.

Returns
The state of the button.

◆ GetCircleButtonPressed()

bool frc::PS4Controller::GetCircleButtonPressed ( )

Whether the circle button was pressed since the last check.

Returns
Whether the button was pressed since the last check.

◆ GetCircleButtonReleased()

bool frc::PS4Controller::GetCircleButtonReleased ( )

Whether the circle button was released since the last check.

Returns
Whether the button was released since the last check.

◆ GetCrossButton()

bool frc::PS4Controller::GetCrossButton ( ) const

Read the value of the cross button on the controller.

Returns
The state of the button.

◆ GetCrossButtonPressed()

bool frc::PS4Controller::GetCrossButtonPressed ( )

Whether the cross button was pressed since the last check.

Returns
Whether the button was pressed since the last check.

◆ GetCrossButtonReleased()

bool frc::PS4Controller::GetCrossButtonReleased ( )

Whether the cross button was released since the last check.

Returns
Whether the button was released since the last check.

◆ GetL1Button()

bool frc::PS4Controller::GetL1Button ( ) const

Read the value of the left trigger 1 button on the controller.

Returns
The state of the button.

◆ GetL1ButtonPressed()

bool frc::PS4Controller::GetL1ButtonPressed ( )

Whether the left trigger 1 button was pressed since the last check.

Returns
Whether the button was pressed since the last check.

◆ GetL1ButtonReleased()

bool frc::PS4Controller::GetL1ButtonReleased ( )

Whether the left trigger 1 button was released since the last check.

Returns
Whether the button was released since the last check.

◆ GetL2Axis()

double frc::PS4Controller::GetL2Axis ( ) const

Get the left trigger 2 axis value of the controller.

Note that this axis is bound to the range of [0, 1] as opposed to the usual [-1, 1].

Returns
the axis value.

◆ GetL2Button()

bool frc::PS4Controller::GetL2Button ( ) const

Read the value of the left trigger 2 button on the controller.

Returns
The state of the button.

◆ GetL2ButtonPressed()

bool frc::PS4Controller::GetL2ButtonPressed ( )

Whether the left trigger 2 button was pressed since the last check.

Returns
Whether the button was pressed since the last check.

◆ GetL2ButtonReleased()

bool frc::PS4Controller::GetL2ButtonReleased ( )

Whether the left trigger 2 button was released since the last check.

Returns
Whether the button was released since the last check.

◆ GetL3Button()

bool frc::PS4Controller::GetL3Button ( ) const

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

Returns
The state of the button.

◆ GetL3ButtonPressed()

bool frc::PS4Controller::GetL3ButtonPressed ( )

Whether the L3 (left stick) button was pressed since the last check.

Returns
Whether the button was pressed since the last check.

◆ GetL3ButtonReleased()

bool frc::PS4Controller::GetL3ButtonReleased ( )

Whether the L3 (left stick) button was released since the last check.

Returns
Whether the button was released since the last check.

◆ GetLeftX()

double frc::PS4Controller::GetLeftX ( ) const

Get the X axis value of left side of the controller.

Returns
the axis value.

◆ GetLeftY()

double frc::PS4Controller::GetLeftY ( ) const

Get the Y axis value of left side of the controller.

Returns
the axis value.

◆ GetOptionsButton()

bool frc::PS4Controller::GetOptionsButton ( ) const

Read the value of the options button on the controller.

Returns
The state of the button.

◆ GetOptionsButtonPressed()

bool frc::PS4Controller::GetOptionsButtonPressed ( )

Whether the options button was pressed since the last check.

Returns
Whether the button was pressed since the last check.

◆ GetOptionsButtonReleased()

bool frc::PS4Controller::GetOptionsButtonReleased ( )

Whether the options button was released since the last check.

Returns
Whether the button was released since the last check.

◆ GetPSButton()

bool frc::PS4Controller::GetPSButton ( ) const

Read the value of the PlayStation button on the controller.

Returns
The state of the button.

◆ GetPSButtonPressed()

bool frc::PS4Controller::GetPSButtonPressed ( )

Whether the PlayStation button was pressed since the last check.

Returns
Whether the button was pressed since the last check.

◆ GetPSButtonReleased()

bool frc::PS4Controller::GetPSButtonReleased ( )

Whether the PlayStation button was released since the last check.

Returns
Whether the button was released since the last check.

◆ GetR1Button()

bool frc::PS4Controller::GetR1Button ( ) const

Read the value of the right trigger 1 button on the controller.

Returns
The state of the button.

◆ GetR1ButtonPressed()

bool frc::PS4Controller::GetR1ButtonPressed ( )

Whether the right trigger 1 button was pressed since the last check.

Returns
Whether the button was pressed since the last check.

◆ GetR1ButtonReleased()

bool frc::PS4Controller::GetR1ButtonReleased ( )

Whether the right trigger 1 button was released since the last check.

Returns
Whether the button was released since the last check.

◆ GetR2Axis()

double frc::PS4Controller::GetR2Axis ( ) const

Get the right trigger 2 axis value of the controller.

Note that this axis is bound to the range of [0, 1] as opposed to the usual [-1, 1].

Returns
the axis value.

◆ GetR2Button()

bool frc::PS4Controller::GetR2Button ( ) const

Read the value of the right trigger 2 button on the controller.

Returns
The state of the button.

◆ GetR2ButtonPressed()

bool frc::PS4Controller::GetR2ButtonPressed ( )

Whether the right trigger 2 button was pressed since the last check.

Returns
Whether the button was pressed since the last check.

◆ GetR2ButtonReleased()

bool frc::PS4Controller::GetR2ButtonReleased ( )

Whether the right trigger 2 button was released since the last check.

Returns
Whether the button was released since the last check.

◆ GetR3Button()

bool frc::PS4Controller::GetR3Button ( ) const

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

Returns
The state of the button.

◆ GetR3ButtonPressed()

bool frc::PS4Controller::GetR3ButtonPressed ( )

Whether the R3 (right stick) button was pressed since the last check.

Returns
Whether the button was pressed since the last check.

◆ GetR3ButtonReleased()

bool frc::PS4Controller::GetR3ButtonReleased ( )

Whether the R3 (right stick) button was released since the last check.

Returns
Whether the button was released since the last check.

◆ GetRightX()

double frc::PS4Controller::GetRightX ( ) const

Get the X axis value of right side of the controller.

Returns
the axis value.

◆ GetRightY()

double frc::PS4Controller::GetRightY ( ) const

Get the Y axis value of right side of the controller.

Returns
the axis value.

◆ GetShareButton()

bool frc::PS4Controller::GetShareButton ( ) const

Read the value of the share button on the controller.

Returns
The state of the button.

◆ GetShareButtonPressed()

bool frc::PS4Controller::GetShareButtonPressed ( )

Whether the share button was pressed since the last check.

Returns
Whether the button was pressed since the last check.

◆ GetShareButtonReleased()

bool frc::PS4Controller::GetShareButtonReleased ( )

Whether the share button was released since the last check.

Returns
Whether the button was released since the last check.

◆ GetSquareButton()

bool frc::PS4Controller::GetSquareButton ( ) const

Read the value of the square button on the controller.

Returns
The state of the button.

◆ GetSquareButtonPressed()

bool frc::PS4Controller::GetSquareButtonPressed ( )

Whether the square button was pressed since the last check.

Returns
Whether the button was pressed since the last check.

◆ GetSquareButtonReleased()

bool frc::PS4Controller::GetSquareButtonReleased ( )

Whether the square button was released since the last check.

Returns
Whether the button was released since the last check.

◆ GetTouchpad()

bool frc::PS4Controller::GetTouchpad ( ) const

Read the value of the touchpad button on the controller.

Returns
The state of the button.
Deprecated
Use GetTouchpadButton instead. This function is deprecated for removal to make function names consistent to allow the HID classes to be automatically generated.

◆ GetTouchpadButton()

bool frc::PS4Controller::GetTouchpadButton ( ) const

Read the value of the touchpad button on the controller.

Returns
The state of the button.

◆ GetTouchpadButtonPressed()

bool frc::PS4Controller::GetTouchpadButtonPressed ( )

Whether the touchpad button was pressed since the last check.

Returns
Whether the button was pressed since the last check.

◆ GetTouchpadButtonReleased()

bool frc::PS4Controller::GetTouchpadButtonReleased ( )

Whether the touchpad button was released since the last check.

Returns
Whether the button was released since the last check.

◆ GetTouchpadPressed()

bool frc::PS4Controller::GetTouchpadPressed ( )

Whether the touchpad was pressed since the last check.

Returns
Whether the touchpad was pressed since the last check.
Deprecated
Use GetTouchpadButtonPressed instead. This function is deprecated for removal to make function names consistent to allow the HID classes to be automatically generated.

◆ GetTouchpadReleased()

bool frc::PS4Controller::GetTouchpadReleased ( )

Whether the touchpad was released since the last check.

Returns
Whether the touchpad was released since the last check.
Deprecated
Use GetLeftBumperButton instead. This function is deprecated for removal to make function names consistent to allow the HID classes to be automatically generated.

◆ GetTriangleButton()

bool frc::PS4Controller::GetTriangleButton ( ) const

Read the value of the triangle button on the controller.

Returns
The state of the button.

◆ GetTriangleButtonPressed()

bool frc::PS4Controller::GetTriangleButtonPressed ( )

Whether the triangle button was pressed since the last check.

Returns
Whether the button was pressed since the last check.

◆ GetTriangleButtonReleased()

bool frc::PS4Controller::GetTriangleButtonReleased ( )

Whether the triangle button was released since the last check.

Returns
Whether the button was released since the last check.

◆ InitSendable()

void frc::PS4Controller::InitSendable ( wpi::SendableBuilder & builder)
overridevirtual

Initializes this Sendable object.

Parameters
buildersendable builder

Implements wpi::Sendable.

◆ L1()

BooleanEvent frc::PS4Controller::L1 ( EventLoop * loop) const

Constructs an event instance around the left trigger 1 button's digital signal.

Parameters
loopthe event loop instance to attach the event to.
Returns
an event instance representing the left trigger 1 button's digital signal attached to the given loop.

◆ L2()

BooleanEvent frc::PS4Controller::L2 ( EventLoop * loop) const

Constructs an event instance around the left trigger 2 button's digital signal.

Parameters
loopthe event loop instance to attach the event to.
Returns
an event instance representing the left trigger 2 button's digital signal attached to the given loop.

◆ L3()

BooleanEvent frc::PS4Controller::L3 ( EventLoop * loop) const

Constructs an event instance around the L3 (left stick) button's digital signal.

Parameters
loopthe event loop instance to attach the event to.
Returns
an event instance representing the L3 (left stick) button's digital signal attached to the given loop.

◆ operator=()

PS4Controller & frc::PS4Controller::operator= ( PS4Controller && )
default

◆ Options()

BooleanEvent frc::PS4Controller::Options ( EventLoop * loop) const

Constructs an event instance around the options button's digital signal.

Parameters
loopthe event loop instance to attach the event to.
Returns
an event instance representing the options button's digital signal attached to the given loop.

◆ PS()

BooleanEvent frc::PS4Controller::PS ( EventLoop * loop) const

Constructs an event instance around the PlayStation button's digital signal.

Parameters
loopthe event loop instance to attach the event to.
Returns
an event instance representing the PlayStation button's digital signal attached to the given loop.

◆ R1()

BooleanEvent frc::PS4Controller::R1 ( EventLoop * loop) const

Constructs an event instance around the right trigger 1 button's digital signal.

Parameters
loopthe event loop instance to attach the event to.
Returns
an event instance representing the right trigger 1 button's digital signal attached to the given loop.

◆ R2()

BooleanEvent frc::PS4Controller::R2 ( EventLoop * loop) const

Constructs an event instance around the right trigger 2 button's digital signal.

Parameters
loopthe event loop instance to attach the event to.
Returns
an event instance representing the right trigger 2 button's digital signal attached to the given loop.

◆ R3()

BooleanEvent frc::PS4Controller::R3 ( EventLoop * loop) const

Constructs an event instance around the R3 (right stick) button's digital signal.

Parameters
loopthe event loop instance to attach the event to.
Returns
an event instance representing the R3 (right stick) button's digital signal attached to the given loop.

◆ Share()

BooleanEvent frc::PS4Controller::Share ( EventLoop * loop) const

Constructs an event instance around the share button's digital signal.

Parameters
loopthe event loop instance to attach the event to.
Returns
an event instance representing the share button's digital signal attached to the given loop.

◆ Square()

BooleanEvent frc::PS4Controller::Square ( EventLoop * loop) const

Constructs an event instance around the square button's digital signal.

Parameters
loopthe event loop instance to attach the event to.
Returns
an event instance representing the square button's digital signal attached to the given loop.

◆ Touchpad()

BooleanEvent frc::PS4Controller::Touchpad ( EventLoop * loop) const

Constructs an event instance around the touchpad button's digital signal.

Parameters
loopthe event loop instance to attach the event to.
Returns
an event instance representing the touchpad button's digital signal attached to the given loop.

◆ Triangle()

BooleanEvent frc::PS4Controller::Triangle ( EventLoop * loop) const

Constructs an event instance around the triangle button's digital signal.

Parameters
loopthe event loop instance to attach the event to.
Returns
an event instance representing the triangle button's digital signal attached to the given loop.

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