533 [[deprecated(
"Use GetTouchpadButton instead")]]
543 [[deprecated(
"Use GetTouchpadButtonPressed instead")]]
554 [[deprecated(
"Use GetTouchpadButtonReleased instead")]]
568 static constexpr int kL1 = 5;
570 static constexpr int kR1 = 6;
572 static constexpr int kL2 = 7;
574 static constexpr int kR2 = 8;
580 static constexpr int kL3 = 11;
582 static constexpr int kR3 = 12;
584 static constexpr int kPS = 13;
600 static constexpr int kL2 = 3;
602 static constexpr int kR2 = 4;
This class provides an easy way to link actions to active high logic signals.
Definition BooleanEvent.h:30
A declarative way to bind a set of actions to a loop and execute them when the loop is polled.
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:30
bool GetR1ButtonPressed()
Whether the right trigger 1 button was pressed since the last check.
bool GetR2Button() const
Read the value of the right trigger 2 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 left trigger 1 button on the controller.
bool GetR2ButtonReleased()
Whether the right trigger 2 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 (left stick) button on the controller.
bool GetPSButtonPressed()
Whether the PlayStation button was pressed 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.
BooleanEvent R1(EventLoop *loop) const
Constructs an event instance around the right trigger 1 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 right trigger 1 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 right trigger 2 button's digital signal.
bool GetL1ButtonReleased()
Whether the left trigger 1 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 PlayStation 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 right trigger 1 button on the controller.
BooleanEvent Touchpad(EventLoop *loop) const
Constructs an event instance around the touchpad button's digital signal.
PS4Controller(int port)
Construct an instance of a 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 left trigger 1 button's digital signal.
BooleanEvent PS(EventLoop *loop) const
Constructs an event instance around the PlayStation button's digital signal.
bool GetTriangleButtonReleased()
Whether the triangle button was released since the last check.
bool GetL1ButtonPressed()
Whether the left trigger 1 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 (right stick) button on the controller.
bool GetOptionsButton() const
Read the value of the options button on the controller.
double GetR2Axis() const
Get the right trigger 2 axis value of the controller.
bool GetL2Button() const
Read the value of the left trigger 2 button on the controller.
bool GetL2ButtonReleased()
Whether the left trigger 2 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 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 GetL2ButtonPressed()
Whether the left trigger 2 button was pressed since the last check.
bool GetShareButtonPressed()
Whether the share button was pressed since the last check.
bool GetR2ButtonPressed()
Whether the right trigger 2 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 (left stick) button's digital signal.
bool GetTouchpadButtonReleased()
Whether the touchpad button was released since the last check.
bool GetTouchpadPressed()
Whether the touchpad was pressed since the last check.
~PS4Controller() override=default
void InitSendable(wpi::SendableBuilder &builder) override
Initializes this Sendable object.
bool GetCircleButtonReleased()
Whether the circle button was released since the last check.
double GetL2Axis() const
Get the left trigger 2 axis value of the controller.
BooleanEvent L2(EventLoop *loop) const
Constructs an event instance around the left trigger 2 button's digital signal.
Helper class for building Sendable dashboard representations.
Definition SendableBuilder.h:21
A helper class for use with objects that add themselves to SendableRegistry.
Definition SendableHelper.h:21
Interface for Sendable objects.
Definition Sendable.h:16
Represents an axis on an PS4Controller.
Definition PS4Controller.h:590
static constexpr int kRightY
Right Y axis.
Definition PS4Controller.h:598
static constexpr int kR2
Right trigger 2.
Definition PS4Controller.h:602
static constexpr int kLeftX
Left X axis.
Definition PS4Controller.h:592
static constexpr int kRightX
Right X axis.
Definition PS4Controller.h:596
static constexpr int kL2
Left trigger 2.
Definition PS4Controller.h:600
static constexpr int kLeftY
Left Y axis.
Definition PS4Controller.h:594