1091 double GetAxisForSendable(
Axis axis)
const;
1092 bool GetButtonForSendable(
Button button)
const;
This class provides an easy way to link actions to active high logic signals.
Definition BooleanEvent.hpp:28
A declarative way to bind a set of actions to a loop and execute them when the loop is polled.
Definition EventLoop.hpp:15
bool GetMisc5Button() const
Read the value of the Miscellaneous 5 button on the controller.
BooleanEvent RightBumper(EventLoop *loop) const
Constructs an event instance around the right bumper button's digital signal.
BooleanEvent RightPaddle1(EventLoop *loop) const
Constructs an event instance around the Right Paddle 1 button's digital signal.
Gamepad & operator=(Gamepad &&)=default
BooleanEvent RightStick(EventLoop *loop) const
Constructs an event instance around the right stick button's digital signal.
~Gamepad() override=default
BooleanEvent Guide(EventLoop *loop) const
Constructs an event instance around the Guide button's digital signal.
bool GetButtonPressed(Button button)
Whether the button was pressed since the last check.
BooleanEvent AxisGreaterThan(Axis axis, double threshold, EventLoop *loop) const
Constructs an event instance that is true when the axis value is greater than threshold.
bool GetStartButtonReleased()
Whether the Start button was released since the last check.
bool GetMisc5ButtonPressed()
Whether the Miscellaneous 5 button was pressed since the last check.
bool GetSouthFaceButton() const
Read the value of the South Face button on the controller.
BooleanEvent Misc1(EventLoop *loop) const
Constructs an event instance around the Miscellaneous 1 button's digital signal.
BooleanEvent RightTrigger(double threshold, EventLoop *loop) const
Constructs an event instance around the axis value of the right trigger.
BooleanEvent Misc6(EventLoop *loop) const
Constructs an event instance around the Miscellaneous 6 button's digital signal.
bool GetDpadLeftButtonPressed()
Whether the D-pad left button was pressed since the last check.
bool GetDpadLeftButton() const
Read the value of the D-pad left button on the controller.
double GetAxis(Axis axis) const
Get the value of the axis.
bool GetMisc4ButtonReleased()
Whether the Miscellaneous 4 button was released since the last check.
bool GetDpadDownButton() const
Read the value of the D-pad down button on the controller.
bool GetWestFaceButtonReleased()
Whether the West Face button was released since the last check.
bool GetDpadUpButtonPressed()
Whether the D-pad up button was pressed since the last check.
Gamepad(int port)
Construct an instance of a controller.
BooleanEvent LeftPaddle2(EventLoop *loop) const
Constructs an event instance around the Left Paddle 2 button's digital signal.
bool GetBackButton() const
Read the value of the Back button on the controller.
bool GetMisc2ButtonReleased()
Whether the Miscellaneous 2 button was released since the last check.
BooleanEvent NorthFace(EventLoop *loop) const
Constructs an event instance around the North Face button's digital signal.
bool GetMisc3Button() const
Read the value of the Miscellaneous 3 button on the controller.
bool GetBackButtonReleased()
Whether the Back button was released since the last check.
bool GetDpadRightButtonReleased()
Whether the D-pad right button was released since the last check.
bool GetRightStickButtonPressed()
Whether the right stick button was pressed since the last check.
BooleanEvent LeftPaddle1(EventLoop *loop) const
Constructs an event instance around the Left Paddle 1 button's digital signal.
bool GetRightPaddle2ButtonReleased()
Whether the Right Paddle 2 button was released since the last check.
bool GetSouthFaceButtonPressed()
Whether the South Face button was pressed since the last check.
bool GetRightPaddle1ButtonReleased()
Whether the Right Paddle 1 button was released since the last check.
double GetRightY() const
Get the Y axis value of right side of the controller.
BooleanEvent RightTrigger(EventLoop *loop) const
Constructs an event instance around the axis value of the right trigger.
double GetLeftTriggerAxis() const
Get the left trigger axis value of the controller.
BooleanEvent Misc4(EventLoop *loop) const
Constructs an event instance around the Miscellaneous 4 button's digital signal.
BooleanEvent ButtonEvent(Button button, EventLoop *loop) const
Constructs an event instance around this button's digital signal.
bool GetEastFaceButton() const
Read the value of the East Face button on the controller.
BooleanEvent Back(EventLoop *loop) const
Constructs an event instance around the Back button's digital signal.
bool GetMisc1ButtonReleased()
Whether the Miscellaneous 1 button was released since the last check.
double GetLeftY() const
Get the Y axis value of left side of the controller.
bool GetDpadDownButtonReleased()
Whether the D-pad down button was released since the last check.
bool GetRightPaddle2Button() const
Read the value of the Right Paddle 2 button on the controller.
bool GetLeftPaddle2ButtonReleased()
Whether the Left Paddle 2 button was released since the last check.
BooleanEvent EastFace(EventLoop *loop) const
Constructs an event instance around the East Face button's digital signal.
BooleanEvent LeftTrigger(double threshold, EventLoop *loop) const
Constructs an event instance around the axis value of the left trigger.
bool GetRightBumperButtonPressed()
Whether the right bumper button was pressed since the last check.
bool GetButton(Button button) const
Get the button value.
bool GetDpadLeftButtonReleased()
Whether the D-pad left button was released since the last check.
bool GetWestFaceButtonPressed()
Whether the West Face button was pressed since the last check.
BooleanEvent Misc3(EventLoop *loop) const
Constructs an event instance around the Miscellaneous 3 button's digital signal.
bool GetRightPaddle1Button() const
Read the value of the Right Paddle 1 button on the controller.
bool GetLeftBumperButtonPressed()
Whether the right bumper button was pressed since the last check.
bool GetGuideButton() const
Read the value of the Guide button on the controller.
bool GetMisc2ButtonPressed()
Whether the Miscellaneous 2 button was pressed since the last check.
bool GetDpadUpButton() const
Read the value of the D-pad up button on the controller.
bool GetTouchpadButtonReleased()
Whether the Touchpad button was released since the last check.
bool GetLeftPaddle1ButtonPressed()
Whether the Left Paddle 1 button was pressed since the last check.
bool GetLeftStickButton() const
Read the value of the left stick button on the controller.
bool GetLeftBumperButtonReleased()
Whether the right bumper button was released since the last check.
bool GetRightBumperButtonReleased()
Whether the right bumper button was released since the last check.
bool GetLeftStickButtonReleased()
Whether the left stick button was released since the last check.
bool GetSouthFaceButtonReleased()
Whether the South Face button was released since the last check.
BooleanEvent DpadRight(EventLoop *loop) const
Constructs an event instance around the D-pad right button's digital signal.
bool GetMisc6ButtonReleased()
Whether the Miscellaneous 6 button was released since the last check.
bool GetMisc3ButtonPressed()
Whether the Miscellaneous 3 button was pressed since the last check.
bool GetMisc6Button() const
Read the value of the Miscellaneous 6 button on the controller.
bool GetDpadUpButtonReleased()
Whether the D-pad up button was released since the last check.
bool GetDpadRightButton() const
Read the value of the D-pad right button on the controller.
bool GetGuideButtonReleased()
Whether the Guide button was released since the last check.
bool GetTouchpadButtonPressed()
Whether the Touchpad button was pressed since the last check.
Button
Represents a digital button on an Gamepad.
Definition Gamepad.hpp:30
@ LEFT_BUMPER
Left bumper button.
Definition Gamepad.hpp:50
@ BACK
Back button.
Definition Gamepad.hpp:40
@ DPAD_LEFT
D-pad left button.
Definition Gamepad.hpp:58
@ SOUTH_FACE
South Face button.
Definition Gamepad.hpp:32
@ MISC_1
Miscellaneous 1 button.
Definition Gamepad.hpp:62
@ WEST_FACE
West Face button.
Definition Gamepad.hpp:36
@ DPAD_UP
D-pad up button.
Definition Gamepad.hpp:54
@ DPAD_RIGHT
D-pad right button.
Definition Gamepad.hpp:60
@ RIGHT_BUMPER
Right bumper button.
Definition Gamepad.hpp:52
@ MISC_6
Miscellaneous 6 button.
Definition Gamepad.hpp:82
@ RIGHT_STICK
Right stick button.
Definition Gamepad.hpp:48
@ MISC_2
Miscellaneous 2 button.
Definition Gamepad.hpp:74
@ NORTH_FACE
North Face button.
Definition Gamepad.hpp:38
@ START
Start button.
Definition Gamepad.hpp:44
@ TOUCHPAD
Touchpad button.
Definition Gamepad.hpp:72
@ RIGHT_PADDLE_1
Right Paddle 1 button.
Definition Gamepad.hpp:64
@ MISC_3
Miscellaneous 3 button.
Definition Gamepad.hpp:76
@ MISC_5
Miscellaneous 5 button.
Definition Gamepad.hpp:80
@ LEFT_STICK
Left stick button.
Definition Gamepad.hpp:46
@ RIGHT_PADDLE_2
Right Paddle 2 button.
Definition Gamepad.hpp:68
@ MISC_4
Miscellaneous 4 button.
Definition Gamepad.hpp:78
@ LEFT_PADDLE_1
Left Paddle 1 button.
Definition Gamepad.hpp:66
@ EAST_FACE
East Face button.
Definition Gamepad.hpp:34
@ LEFT_PADDLE_2
Left Paddle 2 button.
Definition Gamepad.hpp:70
@ DPAD_DOWN
D-pad down button.
Definition Gamepad.hpp:56
@ GUIDE
Guide button.
Definition Gamepad.hpp:42
void InitSendable(wpi::util::SendableBuilder &builder) override
Initializes this Sendable object.
bool GetMisc4Button() const
Read the value of the Miscellaneous 4 button on the controller.
Gamepad(Gamepad &&)=default
bool GetMisc2Button() const
Read the value of the Miscellaneous 2 button on the controller.
bool GetLeftPaddle2Button() const
Read the value of the Left Paddle 2 button on the controller.
bool GetDpadDownButtonPressed()
Whether the D-pad down button was pressed since the last check.
BooleanEvent WestFace(EventLoop *loop) const
Constructs an event instance around the West Face button's digital signal.
bool GetRightPaddle2ButtonPressed()
Whether the Right Paddle 2 button was pressed since the last check.
BooleanEvent Touchpad(EventLoop *loop) const
Constructs an event instance around the Touchpad button's digital signal.
bool GetMisc6ButtonPressed()
Whether the Miscellaneous 6 button was pressed since the last check.
bool GetLeftBumperButton() const
Read the value of the right bumper button on the controller.
BooleanEvent LeftStick(EventLoop *loop) const
Constructs an event instance around the left stick button's digital signal.
bool GetMisc1Button() const
Read the value of the Miscellaneous 1 button on the controller.
BooleanEvent SouthFace(EventLoop *loop) const
Constructs an event instance around the South Face button's digital signal.
bool GetTouchpadButton() const
Read the value of the Touchpad button on the controller.
bool GetLeftPaddle2ButtonPressed()
Whether the Left Paddle 2 button was pressed since the last check.
bool GetDpadRightButtonPressed()
Whether the D-pad right button was pressed since the last check.
BooleanEvent DpadLeft(EventLoop *loop) const
Constructs an event instance around the D-pad left button's digital signal.
bool GetRightPaddle1ButtonPressed()
Whether the Right Paddle 1 button was pressed since the last check.
bool GetMisc3ButtonReleased()
Whether the Miscellaneous 3 button was released since the last check.
bool GetRightBumperButton() const
Read the value of the right bumper button on the controller.
bool GetRightStickButton() const
Read the value of the right stick button on the controller.
bool GetEastFaceButtonPressed()
Whether the East Face button was pressed since the last check.
bool GetLeftPaddle1Button() const
Read the value of the Left Paddle 1 button on the controller.
bool GetBackButtonPressed()
Whether the Back button was pressed since the last check.
BooleanEvent DpadDown(EventLoop *loop) const
Constructs an event instance around the D-pad down button's digital signal.
bool GetLeftPaddle1ButtonReleased()
Whether the Left Paddle 1 button was released since the last check.
BooleanEvent Misc5(EventLoop *loop) const
Constructs an event instance around the Miscellaneous 5 button's digital signal.
BooleanEvent LeftTrigger(EventLoop *loop) const
Constructs an event instance around the axis value of the left trigger.
Axis
Represents an axis on an Gamepad.
Definition Gamepad.hpp:86
@ RIGHT_TRIGGER
Right trigger.
Definition Gamepad.hpp:98
@ LEFT_TRIGGER
Left trigger.
Definition Gamepad.hpp:96
@ RIGHT_Y
Right Y axis.
Definition Gamepad.hpp:94
@ LEFT_Y
Left Y axis.
Definition Gamepad.hpp:90
@ LEFT_X
Left X axis.
Definition Gamepad.hpp:88
@ RIGHT_X
Right X axis.
Definition Gamepad.hpp:92
double GetLeftX() const
Get the X axis value of left side of the controller.
double GetRightTriggerAxis() const
Get the right trigger axis value of the controller.
BooleanEvent AxisLessThan(Axis axis, double threshold, EventLoop *loop) const
Constructs an event instance that is true when the axis value is less than threshold.
BooleanEvent DpadUp(EventLoop *loop) const
Constructs an event instance around the D-pad up button's digital signal.
bool GetMisc1ButtonPressed()
Whether the Miscellaneous 1 button was pressed since the last check.
BooleanEvent LeftBumper(EventLoop *loop) const
Constructs an event instance around the right bumper button's digital signal.
double GetRightX() const
Get the X axis value of right side of the controller.
bool GetNorthFaceButton() const
Read the value of the North Face button on the controller.
bool GetEastFaceButtonReleased()
Whether the East Face button was released since the last check.
bool GetWestFaceButton() const
Read the value of the West Face button on the controller.
bool GetNorthFaceButtonReleased()
Whether the North Face button was released since the last check.
BooleanEvent RightPaddle2(EventLoop *loop) const
Constructs an event instance around the Right Paddle 2 button's digital signal.
BooleanEvent Misc2(EventLoop *loop) const
Constructs an event instance around the Miscellaneous 2 button's digital signal.
bool GetGuideButtonPressed()
Whether the Guide button was pressed since the last check.
bool GetMisc4ButtonPressed()
Whether the Miscellaneous 4 button was pressed since the last check.
bool GetMisc5ButtonReleased()
Whether the Miscellaneous 5 button was released since the last check.
bool GetLeftStickButtonPressed()
Whether the left stick button was pressed since the last check.
bool GetStartButtonPressed()
Whether the Start button was pressed since the last check.
bool GetButtonReleased(Button button)
Whether the button was released since the last check.
bool GetRightStickButtonReleased()
Whether the right stick button was released since the last check.
bool GetNorthFaceButtonPressed()
Whether the North Face button was pressed since the last check.
bool GetStartButton() const
Read the value of the Start button on the controller.
BooleanEvent Start(EventLoop *loop) const
Constructs an event instance around the Start button's digital signal.
Helper class for building Sendable dashboard representations.
Definition SendableBuilder.hpp:21
A helper class for use with objects that add themselves to SendableRegistry.
Definition SendableHelper.hpp:21
Interface for Sendable objects.
Definition Sendable.hpp:16
Definition CvSource.hpp:15