453 [[deprecated(
"Use GetLeftBumperButton instead")]]
464 [[deprecated(
"Use GetRightBumperButton instead")]]
475 [[deprecated(
"Use GetLeftBumperButtonPressed instead")]]
486 [[deprecated(
"Use GetRightBumperButtonPressed instead")]]
497 [[deprecated(
"Use GetLeftBumperButtonReleased instead")]]
508 [[deprecated(
"Use GetRightBumperButtonReleased instead")]]
514 static constexpr int kA = 1;
516 static constexpr int kB = 2;
518 static constexpr int kX = 3;
520 static constexpr int kY = 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 Xbox controllers connected to the Driver Station.
Definition XboxController.h:30
bool GetBButtonReleased()
Whether the B button was released since the last check.
BooleanEvent A(EventLoop *loop) const
Constructs an event instance around the A button's digital signal.
bool GetBackButtonPressed()
Whether the back button was pressed since the last check.
bool GetStartButtonPressed()
Whether the start button was pressed since the last check.
bool GetBButtonPressed()
Whether the B button was pressed since the last check.
double GetLeftX() const
Get the X axis value of left side of the controller.
bool GetAButton() const
Read the value of the A button on the controller.
bool GetLeftBumper() const
Read the value of the left bumper (LB) button on the controller.
bool GetLeftStickButton() const
Read the value of the left stick button on the controller.
BooleanEvent Back(EventLoop *loop) const
Constructs an event instance around the back button's digital signal.
BooleanEvent LeftStick(EventLoop *loop) const
Constructs an event instance around the left stick button's digital signal.
bool GetRightBumperReleased()
Whether the right bumper (RB) was released since the last check.
bool GetAButtonReleased()
Whether the A button was released since the last check.
BooleanEvent Start(EventLoop *loop) const
Constructs an event instance around the start button's digital signal.
bool GetLeftBumperButton() const
Read the value of the left bumper button on the controller.
bool GetBButton() const
Read the value of the B button on the controller.
XboxController(XboxController &&)=default
double GetLeftY() const
Get the Y axis value of left side of the controller.
bool GetXButtonPressed()
Whether the X button was pressed since the last check.
XboxController & operator=(XboxController &&)=default
BooleanEvent B(EventLoop *loop) const
Constructs an event instance around the B button's digital signal.
double GetLeftTriggerAxis() const
Get the left trigger axis value of the controller.
bool GetYButtonReleased()
Whether the Y button was released since the last check.
bool GetRightBumperButtonReleased()
Whether the right bumper button was released since the last check.
BooleanEvent RightBumper(EventLoop *loop) const
Constructs an event instance around the right bumper button's digital signal.
void InitSendable(wpi::SendableBuilder &builder) override
Initializes this Sendable object.
BooleanEvent RightTrigger(EventLoop *loop) const
Constructs an event instance around the axis value of the right trigger.
bool GetLeftBumperPressed()
Whether the left bumper (LB) was pressed since the last check.
bool GetXButtonReleased()
Whether the X button was released since the last check.
bool GetRightBumper() const
Read the value of the right bumper (RB) button on the controller.
bool GetBackButtonReleased()
Whether the back button was released since the last check.
XboxController(int port)
Construct an instance of a controller.
bool GetLeftBumperReleased()
Whether the left bumper (LB) was released since the last check.
BooleanEvent RightTrigger(double threshold, EventLoop *loop) const
Constructs an event instance around the axis value of the right trigger.
bool GetRightBumperButtonPressed()
Whether the right bumper button was pressed since the last check.
bool GetLeftBumperButtonPressed()
Whether the left bumper button was pressed since the last check.
~XboxController() override=default
bool GetRightStickButtonPressed()
Whether the right stick button was pressed since the last check.
bool GetLeftBumperButtonReleased()
Whether the left bumper button was released since the last check.
bool GetYButton() const
Read the value of the Y button on the controller.
BooleanEvent LeftTrigger(EventLoop *loop) const
Constructs an event instance around the axis value of the left trigger.
double GetRightY() const
Get the Y axis value of right side of the controller.
bool GetAButtonPressed()
Whether the A button was pressed since the last check.
BooleanEvent X(EventLoop *loop) const
Constructs an event instance around the X button's digital signal.
BooleanEvent RightStick(EventLoop *loop) const
Constructs an event instance around the right stick button's digital signal.
bool GetLeftStickButtonPressed()
Whether the left stick button was pressed since the last check.
bool GetRightStickButtonReleased()
Whether the right stick button was released since the last check.
bool GetRightBumperPressed()
Whether the right bumper (RB) was pressed since the last check.
bool GetXButton() const
Read the value of the X button on the controller.
bool GetRightStickButton() const
Read the value of the right stick button on the controller.
bool GetStartButtonReleased()
Whether the start button was released since the last check.
bool GetLeftStickButtonReleased()
Whether the left stick button was released since the last check.
bool GetRightBumperButton() const
Read the value of the right bumper button on the controller.
double GetRightTriggerAxis() const
Get the right trigger axis value of the controller.
BooleanEvent LeftBumper(EventLoop *loop) const
Constructs an event instance around the left bumper button's digital signal.
bool GetBackButton() const
Read the value of the back button on the controller.
bool GetStartButton() const
Read the value of the start button on the controller.
BooleanEvent LeftTrigger(double threshold, EventLoop *loop) const
Constructs an event instance around the axis value of the left trigger.
bool GetYButtonPressed()
Whether the Y button was pressed since the last check.
BooleanEvent Y(EventLoop *loop) const
Constructs an event instance around the Y button's digital signal.
double GetRightX() const
Get the X axis value of right side of the controller.
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 XboxController.
Definition XboxController.h:536
static constexpr int kLeftTrigger
Left trigger.
Definition XboxController.h:546
static constexpr int kLeftY
Left Y axis.
Definition XboxController.h:542
static constexpr int kLeftX
Left X axis.
Definition XboxController.h:538
static constexpr int kRightTrigger
Right trigger.
Definition XboxController.h:548
static constexpr int kRightY
Right Y axis.
Definition XboxController.h:544
static constexpr int kRightX
Right X axis.
Definition XboxController.h:540