507 static constexpr int kL1 = 5;
508 static constexpr int kR1 = 6;
509 static constexpr int kL2 = 7;
510 static constexpr int kR2 = 8;
513 static constexpr int kL3 = 11;
514 static constexpr int kR3 = 12;
515 static constexpr int kPS = 13;
524 static constexpr int kL2 = 3;
525 static constexpr int kR2 = 4;
This class provides an easy way to link actions to inputs.
Definition: BooleanEvent.h:31
The loop polling BooleanEvent objects and executing the actions bound to them.
Definition: EventLoop.h:15
Handle input from standard HID devices connected to the Driver Station.
Definition: GenericHID.h:24
Handle input from PS4 controllers connected to the Driver Station.
Definition: PS4Controller.h:19
bool GetR1ButtonPressed()
Whether the R1 button was pressed since the last check.
bool GetR2Button() const
Read the value of the R2 button on the controller.
BooleanEvent Options(EventLoop *loop) const
Constructs an event instance around the options button's digital signal.
BooleanEvent Square(EventLoop *loop) const
Constructs an event instance around the square button's digital signal.
bool GetSquareButton() const
Read the value of the Square button on the controller.
bool GetL1Button() const
Read the value of the L1 button on the controller.
bool GetR2ButtonReleased()
Whether the R2 button was released since the last check.
BooleanEvent Circle(EventLoop *loop) const
Constructs an event instance around the circle button's digital signal.
bool GetTouchpad() const
Read the value of the touchpad button on the controller.
BooleanEvent Triangle(EventLoop *loop) const
Constructs an event instance around the triangle button's digital signal.
bool GetSquareButtonReleased()
Whether the Square button was released since the last check.
double GetRightY() const
Get the Y axis value of right side of the controller.
bool GetShareButtonReleased()
Whether the Share button was released since the last check.
BooleanEvent Cross(EventLoop *loop) const
Constructs an event instance around the cross button's digital signal.
bool GetR3ButtonPressed()
Whether the R3 (right stick) button was pressed since the last check.
bool GetL3ButtonReleased()
Whether the L3 (left stick) button was released since the last check.
bool GetL3Button() const
Read the value of the L3 button (pressing the left analog stick) on the controller.
bool GetPSButtonPressed()
Whether the PS button was pressed since the last check.
BooleanEvent R3(EventLoop *loop) const
Constructs an event instance around the R3 button's digital signal.
bool GetPSButton() const
Read the value of the PS button on the controller.
BooleanEvent R1(EventLoop *loop) const
Constructs an event instance around the R1 button's digital signal.
double GetRightX() const
Get the X axis value of right side of the controller.
bool GetL3ButtonPressed()
Whether the L3 (left stick) button was pressed since the last check.
bool GetR1ButtonReleased()
Whether the R1 button was released since the last check.
bool GetOptionsButtonPressed()
Whether the Options button was pressed since the last check.
BooleanEvent R2(EventLoop *loop) const
Constructs an event instance around the R2 button's digital signal.
bool GetL1ButtonReleased()
Whether the L1 button was released since the last check.
double GetLeftY() const
Get the Y axis value of left side of the controller.
bool GetCrossButtonPressed()
Whether the Cross button was pressed since the last check.
bool GetShareButton() const
Read the value of the Share button on the controller.
BooleanEvent Share(EventLoop *loop) const
Constructs an event instance around the share button's digital signal.
bool GetPSButtonReleased()
Whether the PS button was released since the last check.
bool GetCrossButton() const
Read the value of the Cross button on the controller.
bool GetCircleButton() const
Read the value of the Circle button on the controller.
bool GetCrossButtonReleased()
Whether the Cross button was released since the last check.
double GetLeftX() const
Get the X axis value of left side of the controller.
bool GetR1Button() const
Read the value of the R1 button on the controller.
BooleanEvent Touchpad(EventLoop *loop) const
Constructs an event instance around the touchpad's digital signal.
PS4Controller(int port)
Construct an instance of an PS4 controller.
bool GetTriangleButton() const
Read the value of the Triangle button on the controller.
BooleanEvent L1(EventLoop *loop) const
Constructs an event instance around the L1 button's digital signal.
BooleanEvent PS(EventLoop *loop) const
Constructs an event instance around the PS button's digital signal.
bool GetTriangleButtonReleased()
Whether the Triangle button was released since the last check.
bool GetL1ButtonPressed()
Whether the L1 button was pressed since the last check.
bool GetSquareButtonPressed()
Whether the Square button was pressed since the last check.
bool GetCircleButtonPressed()
Whether the Circle button was pressed since the last check.
bool GetTouchpadReleased()
Whether the touchpad was released since the last check.
bool GetTriangleButtonPressed()
Whether the Triangle button was pressed since the last check.
bool GetR3Button() const
Read the value of the R3 button (pressing the right analog stick) on the controller.
bool GetOptionsButton() const
Read the value of the Options button on the controller.
double GetR2Axis() const
Get the R2 axis value of the controller.
bool GetL2Button() const
Read the value of the L2 button on the controller.
bool GetL2ButtonReleased()
Whether the L2 button was released since the last check.
bool GetOptionsButtonReleased()
Whether the Options button was released since the last check.
bool GetR3ButtonReleased()
Whether the R3 (right stick) button was released since the last check.
bool GetL2ButtonPressed()
Whether the L2 button was pressed since the last check.
bool GetShareButtonPressed()
Whether the Share button was pressed since the last check.
bool GetR2ButtonPressed()
Whether the R2 button was pressed since the last check.
PS4Controller(PS4Controller &&)=default
PS4Controller & operator=(PS4Controller &&)=default
BooleanEvent L3(EventLoop *loop) const
Constructs an event instance around the L3 button's digital signal.
bool GetTouchpadPressed()
Whether the touchpad was pressed since the last check.
~PS4Controller() override=default
bool GetCircleButtonReleased()
Whether the Circle button was released since the last check.
double GetL2Axis() const
Get the L2 axis value of the controller.
BooleanEvent L2(EventLoop *loop) const
Constructs an event instance around the L2 button's digital signal.
Definition: AprilTagFieldLayout.h:22
Definition: PS4Controller.h:519
static constexpr int kRightY
Definition: PS4Controller.h:523
static constexpr int kR2
Definition: PS4Controller.h:525
static constexpr int kLeftX
Definition: PS4Controller.h:520
static constexpr int kRightX
Definition: PS4Controller.h:522
static constexpr int kL2
Definition: PS4Controller.h:524
static constexpr int kLeftY
Definition: PS4Controller.h:521