![]() |
WPILibC++ 2027.0.0-alpha-4
|
Handle input from Gamepad controllers connected to the Driver Station. More...
#include <wpi/driverstation/Gamepad.hpp>
Classes | |
| struct | Button |
| Represents a digital button on an Gamepad. More... | |
| struct | Axis |
| Represents an axis on an Gamepad. More... | |
Public Member Functions | |
| Gamepad (int port) | |
| Construct an instance of a controller. | |
| ~Gamepad () override=default | |
| Gamepad (Gamepad &&)=default | |
| Gamepad & | operator= (Gamepad &&)=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 | GetLeftTriggerAxis () const |
| Get the left trigger axis value of the controller. | |
| BooleanEvent | LeftTrigger (double threshold, EventLoop *loop) const |
| Constructs an event instance around the axis value of the left trigger. | |
| BooleanEvent | LeftTrigger (EventLoop *loop) const |
| Constructs an event instance around the axis value of the left trigger. | |
| double | GetRightTriggerAxis () const |
| Get the right trigger axis value of the controller. | |
| BooleanEvent | RightTrigger (double threshold, EventLoop *loop) const |
| Constructs an event instance around the axis value of the right trigger. | |
| BooleanEvent | RightTrigger (EventLoop *loop) const |
| Constructs an event instance around the axis value of the right trigger. | |
| bool | GetSouthFaceButton () const |
| Read the value of the South Face button on the controller. | |
| bool | GetSouthFaceButtonPressed () |
| Whether the South Face button was pressed since the last check. | |
| bool | GetSouthFaceButtonReleased () |
| Whether the South Face button was released since the last check. | |
| BooleanEvent | SouthFace (EventLoop *loop) const |
| Constructs an event instance around the South Face button's digital signal. | |
| bool | GetEastFaceButton () const |
| Read the value of the East Face button on the controller. | |
| bool | GetEastFaceButtonPressed () |
| Whether the East Face button was pressed since the last check. | |
| bool | GetEastFaceButtonReleased () |
| Whether the East Face button was released since the last check. | |
| BooleanEvent | EastFace (EventLoop *loop) const |
| Constructs an event instance around the East Face button's digital signal. | |
| bool | GetWestFaceButton () const |
| Read the value of the West Face button on the controller. | |
| bool | GetWestFaceButtonPressed () |
| Whether the West Face button was pressed since the last check. | |
| bool | GetWestFaceButtonReleased () |
| Whether the West Face button was released since the last check. | |
| BooleanEvent | WestFace (EventLoop *loop) const |
| Constructs an event instance around the West Face button's digital signal. | |
| bool | GetNorthFaceButton () const |
| Read the value of the North Face button on the controller. | |
| bool | GetNorthFaceButtonPressed () |
| Whether the North Face button was pressed since the last check. | |
| bool | GetNorthFaceButtonReleased () |
| Whether the North Face 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 | GetBackButton () const |
| Read the value of the Back button on the controller. | |
| bool | GetBackButtonPressed () |
| Whether the Back button was pressed since the last check. | |
| bool | GetBackButtonReleased () |
| Whether the Back button was released since the last check. | |
| BooleanEvent | Back (EventLoop *loop) const |
| Constructs an event instance around the Back button's digital signal. | |
| bool | GetGuideButton () const |
| Read the value of the Guide button on the controller. | |
| bool | GetGuideButtonPressed () |
| Whether the Guide button was pressed since the last check. | |
| bool | GetGuideButtonReleased () |
| Whether the Guide button was released since the last check. | |
| BooleanEvent | Guide (EventLoop *loop) const |
| Constructs an event instance around the Guide button's digital signal. | |
| bool | GetStartButton () const |
| Read the value of the Start button on the controller. | |
| bool | GetStartButtonPressed () |
| Whether the Start button was pressed since the last check. | |
| bool | GetStartButtonReleased () |
| Whether the Start button was released since the last check. | |
| BooleanEvent | Start (EventLoop *loop) const |
| Constructs an event instance around the Start button's digital signal. | |
| bool | GetLeftStickButton () const |
| Read the value of the left stick button on the controller. | |
| bool | GetLeftStickButtonPressed () |
| Whether the left stick button was pressed since the last check. | |
| bool | GetLeftStickButtonReleased () |
| Whether the left stick button was released since the last check. | |
| BooleanEvent | LeftStick (EventLoop *loop) const |
| Constructs an event instance around the left stick button's digital signal. | |
| bool | GetRightStickButton () const |
| Read the value of the right stick button on the controller. | |
| bool | GetRightStickButtonPressed () |
| Whether the right stick button was pressed since the last check. | |
| bool | GetRightStickButtonReleased () |
| Whether the right stick button was released since the last check. | |
| BooleanEvent | RightStick (EventLoop *loop) const |
| Constructs an event instance around the right stick button's digital signal. | |
| bool | GetLeftBumperButton () const |
| Read the value of the right bumper button on the controller. | |
| bool | GetLeftBumperButtonPressed () |
| Whether the right bumper button was pressed since the last check. | |
| bool | GetLeftBumperButtonReleased () |
| Whether the right bumper button was released since the last check. | |
| BooleanEvent | LeftBumper (EventLoop *loop) const |
| Constructs an event instance around the right bumper button's digital signal. | |
| bool | GetRightBumperButton () const |
| Read the value of the right bumper button on the controller. | |
| bool | GetRightBumperButtonPressed () |
| Whether the right bumper button was pressed 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. | |
| bool | GetDpadUpButton () const |
| Read the value of the D-pad up button on the controller. | |
| bool | GetDpadUpButtonPressed () |
| Whether the D-pad up button was pressed since the last check. | |
| bool | GetDpadUpButtonReleased () |
| Whether the D-pad up button was released since the last check. | |
| BooleanEvent | DpadUp (EventLoop *loop) const |
| Constructs an event instance around the D-pad up button's digital signal. | |
| bool | GetDpadDownButton () const |
| Read the value of the D-pad down button on the controller. | |
| bool | GetDpadDownButtonPressed () |
| Whether the D-pad down button was pressed since the last check. | |
| bool | GetDpadDownButtonReleased () |
| Whether the D-pad down button was released since the last check. | |
| BooleanEvent | DpadDown (EventLoop *loop) const |
| Constructs an event instance around the D-pad down button's digital signal. | |
| bool | GetDpadLeftButton () const |
| Read the value of the D-pad left button on the controller. | |
| bool | GetDpadLeftButtonPressed () |
| Whether the D-pad left button was pressed since the last check. | |
| bool | GetDpadLeftButtonReleased () |
| Whether the D-pad left button was released since the last check. | |
| BooleanEvent | DpadLeft (EventLoop *loop) const |
| Constructs an event instance around the D-pad left button's digital signal. | |
| bool | GetDpadRightButton () const |
| Read the value of the D-pad right button on the controller. | |
| bool | GetDpadRightButtonPressed () |
| Whether the D-pad right button was pressed since the last check. | |
| bool | GetDpadRightButtonReleased () |
| Whether the D-pad right 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 | GetMisc1Button () const |
| Read the value of the Miscellaneous 1 button on the controller. | |
| bool | GetMisc1ButtonPressed () |
| Whether the Miscellaneous 1 button was pressed since the last check. | |
| bool | GetMisc1ButtonReleased () |
| Whether the Miscellaneous 1 button was released since the last check. | |
| BooleanEvent | Misc1 (EventLoop *loop) const |
| Constructs an event instance around the Miscellaneous 1 button's digital signal. | |
| bool | GetRightPaddle1Button () const |
| Read the value of the Right Paddle 1 button on the controller. | |
| bool | GetRightPaddle1ButtonPressed () |
| Whether the Right Paddle 1 button was pressed since the last check. | |
| bool | GetRightPaddle1ButtonReleased () |
| Whether the Right Paddle 1 button was released since the last check. | |
| BooleanEvent | RightPaddle1 (EventLoop *loop) const |
| Constructs an event instance around the Right Paddle 1 button's digital signal. | |
| bool | GetLeftPaddle1Button () const |
| Read the value of the Left Paddle 1 button on the controller. | |
| bool | GetLeftPaddle1ButtonPressed () |
| Whether the Left Paddle 1 button was pressed since the last check. | |
| bool | GetLeftPaddle1ButtonReleased () |
| Whether the Left Paddle 1 button was released since the last check. | |
| BooleanEvent | LeftPaddle1 (EventLoop *loop) const |
| Constructs an event instance around the Left Paddle 1 button's digital signal. | |
| bool | GetRightPaddle2Button () const |
| Read the value of the Right Paddle 2 button on the controller. | |
| bool | GetRightPaddle2ButtonPressed () |
| Whether the Right Paddle 2 button was pressed since the last check. | |
| bool | GetRightPaddle2ButtonReleased () |
| Whether the Right Paddle 2 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. | |
| bool | GetLeftPaddle2Button () const |
| Read the value of the Left Paddle 2 button on the controller. | |
| bool | GetLeftPaddle2ButtonPressed () |
| Whether the Left Paddle 2 button was pressed since the last check. | |
| bool | GetLeftPaddle2ButtonReleased () |
| Whether the Left Paddle 2 button was released since the last check. | |
| BooleanEvent | LeftPaddle2 (EventLoop *loop) const |
| Constructs an event instance around the Left Paddle 2 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 | GetMisc2Button () const |
| Read the value of the Miscellaneous 2 button on the controller. | |
| bool | GetMisc2ButtonPressed () |
| Whether the Miscellaneous 2 button was pressed since the last check. | |
| bool | GetMisc2ButtonReleased () |
| Whether the Miscellaneous 2 button was released since the last check. | |
| BooleanEvent | Misc2 (EventLoop *loop) const |
| Constructs an event instance around the Miscellaneous 2 button's digital signal. | |
| bool | GetMisc3Button () const |
| Read the value of the Miscellaneous 3 button on the controller. | |
| bool | GetMisc3ButtonPressed () |
| Whether the Miscellaneous 3 button was pressed since the last check. | |
| bool | GetMisc3ButtonReleased () |
| Whether the Miscellaneous 3 button was released since the last check. | |
| BooleanEvent | Misc3 (EventLoop *loop) const |
| Constructs an event instance around the Miscellaneous 3 button's digital signal. | |
| bool | GetMisc4Button () const |
| Read the value of the Miscellaneous 4 button on the controller. | |
| bool | GetMisc4ButtonPressed () |
| Whether the Miscellaneous 4 button was pressed since the last check. | |
| bool | GetMisc4ButtonReleased () |
| Whether the Miscellaneous 4 button was released since the last check. | |
| BooleanEvent | Misc4 (EventLoop *loop) const |
| Constructs an event instance around the Miscellaneous 4 button's digital signal. | |
| bool | GetMisc5Button () const |
| Read the value of the Miscellaneous 5 button on the controller. | |
| bool | GetMisc5ButtonPressed () |
| Whether the Miscellaneous 5 button was pressed since the last check. | |
| bool | GetMisc5ButtonReleased () |
| Whether the Miscellaneous 5 button was released since the last check. | |
| BooleanEvent | Misc5 (EventLoop *loop) const |
| Constructs an event instance around the Miscellaneous 5 button's digital signal. | |
| bool | GetMisc6Button () const |
| Read the value of the Miscellaneous 6 button on the controller. | |
| bool | GetMisc6ButtonPressed () |
| Whether the Miscellaneous 6 button was pressed since the last check. | |
| bool | GetMisc6ButtonReleased () |
| Whether the Miscellaneous 6 button was released since the last check. | |
| BooleanEvent | Misc6 (EventLoop *loop) const |
| Constructs an event instance around the Miscellaneous 6 button's digital signal. | |
| void | InitSendable (wpi::util::SendableBuilder &builder) override |
| Initializes this Sendable object. | |
| Public Member Functions inherited from wpi::GenericHID | |
| GenericHID (int port) | |
| virtual | ~GenericHID ()=default |
| GenericHID (GenericHID &&)=default | |
| GenericHID & | operator= (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. | |
| DriverStation::POVDirection | GetPOV (int pov=0) const |
| Get the angle of a POV on the HID. | |
| BooleanEvent | POV (DriverStation::POVDirection angle, EventLoop *loop) const |
| Constructs a BooleanEvent instance based around this angle of a POV on the HID. | |
| BooleanEvent | POV (int pov, DriverStation::POVDirection 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 up direction of the default (index 0) POV on the HID. | |
| BooleanEvent | POVUpRight (EventLoop *loop) const |
| Constructs a BooleanEvent instance based around the up right direction of the default (index 0) POV on the HID. | |
| BooleanEvent | POVRight (EventLoop *loop) const |
| Constructs a BooleanEvent instance based around the right direction of the default (index 0) POV on the HID. | |
| BooleanEvent | POVDownRight (EventLoop *loop) const |
| Constructs a BooleanEvent instance based around the down right direction of the default (index 0) POV on the HID. | |
| BooleanEvent | POVDown (EventLoop *loop) const |
| Constructs a BooleanEvent instance based around the down direction of the default (index 0) POV on the HID. | |
| BooleanEvent | POVDownLeft (EventLoop *loop) const |
| Constructs a BooleanEvent instance based around the down left direction of the default (index 0) POV on the HID. | |
| BooleanEvent | POVLeft (EventLoop *loop) const |
| Constructs a BooleanEvent instance based around the left direction of the default (index 0) POV on the HID. | |
| BooleanEvent | POVUpLeft (EventLoop *loop) const |
| Constructs a BooleanEvent instance based around the up left direction 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 | GetAxesMaximumIndex () const |
| int | GetAxesAvailable () const |
| Get the number of axes for the HID. | |
| int | GetPOVsMaximumIndex () const |
| int | GetPOVsAvailable () const |
| Get the number of POVs for the HID. | |
| int | GetButtonsMaximumIndex () const |
| uint64_t | GetButtonsAvailable () const |
| Get the number of buttons for the HID. | |
| bool | IsConnected () const |
| Get if the HID is connected. | |
| GenericHID::HIDType | GetGamepadType () const |
| Get the type of the HID. | |
| GenericHID::SupportedOutputs | GetSupportedOutputs () const |
| Get the supported outputs of the HID. | |
| std::string | GetName () const |
| Get the name of the HID. | |
| int | GetPort () const |
| Get the port number of the HID. | |
| void | SetLeds (int r, int g, int b) |
| Set leds on the controller. | |
| void | SetRumble (RumbleType type, double value) |
| Set the rumble output for the HID. | |
| bool | GetTouchpadFingerAvailable (int touchpad, int finger) const |
| Check if a touchpad finger is available. | |
| DriverStation::TouchpadFinger | GetTouchpadFinger (int touchpad, int finger) const |
| Get the touchpad finger data. | |
| Public Member Functions inherited from wpi::util::Sendable | |
| virtual constexpr | ~Sendable ()=default |
| Public Member Functions inherited from wpi::util::SendableHelper< Gamepad > | |
| constexpr | SendableHelper (const SendableHelper &rhs)=default |
| constexpr SendableHelper & | operator= (const SendableHelper &rhs)=default |
Additional Inherited Members | |
| Public Types inherited from wpi::GenericHID | |
| enum | RumbleType { kLeftRumble , kRightRumble , kLeftTriggerRumble , kRightTriggerRumble } |
| Represents a rumble output on the Joystick. More... | |
| enum | SupportedOutputs { kNone = 0x0 , kMonoLed = 0x1 , kRgbLed = 0x2 , kPlayerLed = 0x4 , kRumble = 0x8 , kTriggerRumble = 0x10 } |
| Represents the various outputs that a HID may support. More... | |
| enum | HIDType { kUnknown = 0 , kStandard , kXbox360 , kXboxOne , kPS3 , kPS4 , kPS5 , kSwitchPro , kSwitchJoyconLeft , kSwitchJoyconRight , kSwitchJoyconPair } |
| USB HID interface type. More... | |
| Protected Member Functions inherited from wpi::util::SendableHelper< Gamepad > | |
| constexpr | ~SendableHelper () |
Handle input from Gamepad controllers connected to the Driver Station.
This class handles Gamepad 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 Generic 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.
|
explicit |
Construct an instance of a controller.
The controller index is the USB port on the Driver Station.
| port | The port on the Driver Station that the controller is plugged into (0-5). |
|
overridedefault |
|
default |
| BooleanEvent wpi::Gamepad::Back | ( | EventLoop * | loop | ) | const |
Constructs an event instance around the Back button's digital signal.
| loop | the event loop instance to attach the event to. |
| BooleanEvent wpi::Gamepad::DpadDown | ( | EventLoop * | loop | ) | const |
Constructs an event instance around the D-pad down button's digital signal.
| loop | the event loop instance to attach the event to. |
| BooleanEvent wpi::Gamepad::DpadLeft | ( | EventLoop * | loop | ) | const |
Constructs an event instance around the D-pad left button's digital signal.
| loop | the event loop instance to attach the event to. |
| BooleanEvent wpi::Gamepad::DpadRight | ( | EventLoop * | loop | ) | const |
Constructs an event instance around the D-pad right button's digital signal.
| loop | the event loop instance to attach the event to. |
| BooleanEvent wpi::Gamepad::DpadUp | ( | EventLoop * | loop | ) | const |
Constructs an event instance around the D-pad up button's digital signal.
| loop | the event loop instance to attach the event to. |
| BooleanEvent wpi::Gamepad::EastFace | ( | EventLoop * | loop | ) | const |
Constructs an event instance around the East Face button's digital signal.
| loop | the event loop instance to attach the event to. |
| bool wpi::Gamepad::GetBackButton | ( | ) | const |
Read the value of the Back button on the controller.
| bool wpi::Gamepad::GetBackButtonPressed | ( | ) |
Whether the Back button was pressed since the last check.
| bool wpi::Gamepad::GetBackButtonReleased | ( | ) |
Whether the Back button was released since the last check.
| bool wpi::Gamepad::GetDpadDownButton | ( | ) | const |
Read the value of the D-pad down button on the controller.
| bool wpi::Gamepad::GetDpadDownButtonPressed | ( | ) |
Whether the D-pad down button was pressed since the last check.
| bool wpi::Gamepad::GetDpadDownButtonReleased | ( | ) |
Whether the D-pad down button was released since the last check.
| bool wpi::Gamepad::GetDpadLeftButton | ( | ) | const |
Read the value of the D-pad left button on the controller.
| bool wpi::Gamepad::GetDpadLeftButtonPressed | ( | ) |
Whether the D-pad left button was pressed since the last check.
| bool wpi::Gamepad::GetDpadLeftButtonReleased | ( | ) |
Whether the D-pad left button was released since the last check.
| bool wpi::Gamepad::GetDpadRightButton | ( | ) | const |
Read the value of the D-pad right button on the controller.
| bool wpi::Gamepad::GetDpadRightButtonPressed | ( | ) |
Whether the D-pad right button was pressed since the last check.
| bool wpi::Gamepad::GetDpadRightButtonReleased | ( | ) |
Whether the D-pad right button was released since the last check.
| bool wpi::Gamepad::GetDpadUpButton | ( | ) | const |
Read the value of the D-pad up button on the controller.
| bool wpi::Gamepad::GetDpadUpButtonPressed | ( | ) |
Whether the D-pad up button was pressed since the last check.
| bool wpi::Gamepad::GetDpadUpButtonReleased | ( | ) |
Whether the D-pad up button was released since the last check.
| bool wpi::Gamepad::GetEastFaceButton | ( | ) | const |
Read the value of the East Face button on the controller.
| bool wpi::Gamepad::GetEastFaceButtonPressed | ( | ) |
Whether the East Face button was pressed since the last check.
| bool wpi::Gamepad::GetEastFaceButtonReleased | ( | ) |
Whether the East Face button was released since the last check.
| bool wpi::Gamepad::GetGuideButton | ( | ) | const |
Read the value of the Guide button on the controller.
| bool wpi::Gamepad::GetGuideButtonPressed | ( | ) |
Whether the Guide button was pressed since the last check.
| bool wpi::Gamepad::GetGuideButtonReleased | ( | ) |
Whether the Guide button was released since the last check.
| bool wpi::Gamepad::GetLeftBumperButton | ( | ) | const |
Read the value of the right bumper button on the controller.
| bool wpi::Gamepad::GetLeftBumperButtonPressed | ( | ) |
Whether the right bumper button was pressed since the last check.
| bool wpi::Gamepad::GetLeftBumperButtonReleased | ( | ) |
Whether the right bumper button was released since the last check.
| bool wpi::Gamepad::GetLeftPaddle1Button | ( | ) | const |
Read the value of the Left Paddle 1 button on the controller.
| bool wpi::Gamepad::GetLeftPaddle1ButtonPressed | ( | ) |
Whether the Left Paddle 1 button was pressed since the last check.
| bool wpi::Gamepad::GetLeftPaddle1ButtonReleased | ( | ) |
Whether the Left Paddle 1 button was released since the last check.
| bool wpi::Gamepad::GetLeftPaddle2Button | ( | ) | const |
Read the value of the Left Paddle 2 button on the controller.
| bool wpi::Gamepad::GetLeftPaddle2ButtonPressed | ( | ) |
Whether the Left Paddle 2 button was pressed since the last check.
| bool wpi::Gamepad::GetLeftPaddle2ButtonReleased | ( | ) |
Whether the Left Paddle 2 button was released since the last check.
| bool wpi::Gamepad::GetLeftStickButton | ( | ) | const |
Read the value of the left stick button on the controller.
| bool wpi::Gamepad::GetLeftStickButtonPressed | ( | ) |
Whether the left stick button was pressed since the last check.
| bool wpi::Gamepad::GetLeftStickButtonReleased | ( | ) |
Whether the left stick button was released since the last check.
| double wpi::Gamepad::GetLeftTriggerAxis | ( | ) | const |
Get the left trigger axis value of the controller.
Note that this axis is bound to the range of [0, 1] as opposed to the usual [-1, 1].
| double wpi::Gamepad::GetLeftX | ( | ) | const |
Get the X axis value of left side of the controller.
Right is positive.
| double wpi::Gamepad::GetLeftY | ( | ) | const |
Get the Y axis value of left side of the controller.
Back is positive.
| bool wpi::Gamepad::GetMisc1Button | ( | ) | const |
Read the value of the Miscellaneous 1 button on the controller.
| bool wpi::Gamepad::GetMisc1ButtonPressed | ( | ) |
Whether the Miscellaneous 1 button was pressed since the last check.
| bool wpi::Gamepad::GetMisc1ButtonReleased | ( | ) |
Whether the Miscellaneous 1 button was released since the last check.
| bool wpi::Gamepad::GetMisc2Button | ( | ) | const |
Read the value of the Miscellaneous 2 button on the controller.
| bool wpi::Gamepad::GetMisc2ButtonPressed | ( | ) |
Whether the Miscellaneous 2 button was pressed since the last check.
| bool wpi::Gamepad::GetMisc2ButtonReleased | ( | ) |
Whether the Miscellaneous 2 button was released since the last check.
| bool wpi::Gamepad::GetMisc3Button | ( | ) | const |
Read the value of the Miscellaneous 3 button on the controller.
| bool wpi::Gamepad::GetMisc3ButtonPressed | ( | ) |
Whether the Miscellaneous 3 button was pressed since the last check.
| bool wpi::Gamepad::GetMisc3ButtonReleased | ( | ) |
Whether the Miscellaneous 3 button was released since the last check.
| bool wpi::Gamepad::GetMisc4Button | ( | ) | const |
Read the value of the Miscellaneous 4 button on the controller.
| bool wpi::Gamepad::GetMisc4ButtonPressed | ( | ) |
Whether the Miscellaneous 4 button was pressed since the last check.
| bool wpi::Gamepad::GetMisc4ButtonReleased | ( | ) |
Whether the Miscellaneous 4 button was released since the last check.
| bool wpi::Gamepad::GetMisc5Button | ( | ) | const |
Read the value of the Miscellaneous 5 button on the controller.
| bool wpi::Gamepad::GetMisc5ButtonPressed | ( | ) |
Whether the Miscellaneous 5 button was pressed since the last check.
| bool wpi::Gamepad::GetMisc5ButtonReleased | ( | ) |
Whether the Miscellaneous 5 button was released since the last check.
| bool wpi::Gamepad::GetMisc6Button | ( | ) | const |
Read the value of the Miscellaneous 6 button on the controller.
| bool wpi::Gamepad::GetMisc6ButtonPressed | ( | ) |
Whether the Miscellaneous 6 button was pressed since the last check.
| bool wpi::Gamepad::GetMisc6ButtonReleased | ( | ) |
Whether the Miscellaneous 6 button was released since the last check.
| bool wpi::Gamepad::GetNorthFaceButton | ( | ) | const |
Read the value of the North Face button on the controller.
| bool wpi::Gamepad::GetNorthFaceButtonPressed | ( | ) |
Whether the North Face button was pressed since the last check.
| bool wpi::Gamepad::GetNorthFaceButtonReleased | ( | ) |
Whether the North Face button was released since the last check.
| bool wpi::Gamepad::GetRightBumperButton | ( | ) | const |
Read the value of the right bumper button on the controller.
| bool wpi::Gamepad::GetRightBumperButtonPressed | ( | ) |
Whether the right bumper button was pressed since the last check.
| bool wpi::Gamepad::GetRightBumperButtonReleased | ( | ) |
Whether the right bumper button was released since the last check.
| bool wpi::Gamepad::GetRightPaddle1Button | ( | ) | const |
Read the value of the Right Paddle 1 button on the controller.
| bool wpi::Gamepad::GetRightPaddle1ButtonPressed | ( | ) |
Whether the Right Paddle 1 button was pressed since the last check.
| bool wpi::Gamepad::GetRightPaddle1ButtonReleased | ( | ) |
Whether the Right Paddle 1 button was released since the last check.
| bool wpi::Gamepad::GetRightPaddle2Button | ( | ) | const |
Read the value of the Right Paddle 2 button on the controller.
| bool wpi::Gamepad::GetRightPaddle2ButtonPressed | ( | ) |
Whether the Right Paddle 2 button was pressed since the last check.
| bool wpi::Gamepad::GetRightPaddle2ButtonReleased | ( | ) |
Whether the Right Paddle 2 button was released since the last check.
| bool wpi::Gamepad::GetRightStickButton | ( | ) | const |
Read the value of the right stick button on the controller.
| bool wpi::Gamepad::GetRightStickButtonPressed | ( | ) |
Whether the right stick button was pressed since the last check.
| bool wpi::Gamepad::GetRightStickButtonReleased | ( | ) |
Whether the right stick button was released since the last check.
| double wpi::Gamepad::GetRightTriggerAxis | ( | ) | const |
Get the right trigger axis value of the controller.
Note that this axis is bound to the range of [0, 1] as opposed to the usual [-1, 1].
| double wpi::Gamepad::GetRightX | ( | ) | const |
Get the X axis value of right side of the controller.
Right is positive.
| double wpi::Gamepad::GetRightY | ( | ) | const |
Get the Y axis value of right side of the controller.
Back is positive.
| bool wpi::Gamepad::GetSouthFaceButton | ( | ) | const |
Read the value of the South Face button on the controller.
| bool wpi::Gamepad::GetSouthFaceButtonPressed | ( | ) |
Whether the South Face button was pressed since the last check.
| bool wpi::Gamepad::GetSouthFaceButtonReleased | ( | ) |
Whether the South Face button was released since the last check.
| bool wpi::Gamepad::GetStartButton | ( | ) | const |
Read the value of the Start button on the controller.
| bool wpi::Gamepad::GetStartButtonPressed | ( | ) |
Whether the Start button was pressed since the last check.
| bool wpi::Gamepad::GetStartButtonReleased | ( | ) |
Whether the Start button was released since the last check.
| bool wpi::Gamepad::GetTouchpadButton | ( | ) | const |
Read the value of the Touchpad button on the controller.
| bool wpi::Gamepad::GetTouchpadButtonPressed | ( | ) |
Whether the Touchpad button was pressed since the last check.
| bool wpi::Gamepad::GetTouchpadButtonReleased | ( | ) |
Whether the Touchpad button was released since the last check.
| bool wpi::Gamepad::GetWestFaceButton | ( | ) | const |
Read the value of the West Face button on the controller.
| bool wpi::Gamepad::GetWestFaceButtonPressed | ( | ) |
Whether the West Face button was pressed since the last check.
| bool wpi::Gamepad::GetWestFaceButtonReleased | ( | ) |
Whether the West Face button was released since the last check.
| BooleanEvent wpi::Gamepad::Guide | ( | EventLoop * | loop | ) | const |
Constructs an event instance around the Guide button's digital signal.
| loop | the event loop instance to attach the event to. |
|
overridevirtual |
Initializes this Sendable object.
| builder | sendable builder |
Implements wpi::util::Sendable.
| BooleanEvent wpi::Gamepad::LeftBumper | ( | EventLoop * | loop | ) | const |
Constructs an event instance around the right bumper button's digital signal.
| loop | the event loop instance to attach the event to. |
| BooleanEvent wpi::Gamepad::LeftPaddle1 | ( | EventLoop * | loop | ) | const |
Constructs an event instance around the Left Paddle 1 button's digital signal.
| loop | the event loop instance to attach the event to. |
| BooleanEvent wpi::Gamepad::LeftPaddle2 | ( | EventLoop * | loop | ) | const |
Constructs an event instance around the Left Paddle 2 button's digital signal.
| loop | the event loop instance to attach the event to. |
| BooleanEvent wpi::Gamepad::LeftStick | ( | EventLoop * | loop | ) | const |
Constructs an event instance around the left stick button's digital signal.
| loop | the event loop instance to attach the event to. |
| BooleanEvent wpi::Gamepad::LeftTrigger | ( | double | threshold, |
| EventLoop * | loop ) const |
Constructs an event instance around the axis value of the left trigger.
The returned trigger will be true when the axis value is greater than threshold.
| threshold | the minimum axis value for the returned event to be true. This value should be in the range [0, 1] where 0 is the unpressed state of the axis. |
| loop | the event loop instance to attach the event to. |
| BooleanEvent wpi::Gamepad::LeftTrigger | ( | EventLoop * | loop | ) | const |
Constructs an event instance around the axis value of the left trigger.
The returned trigger will be true when the axis value is greater than 0.5.
| loop | the event loop instance to attach the event to. |
| BooleanEvent wpi::Gamepad::Misc1 | ( | EventLoop * | loop | ) | const |
Constructs an event instance around the Miscellaneous 1 button's digital signal.
| loop | the event loop instance to attach the event to. |
| BooleanEvent wpi::Gamepad::Misc2 | ( | EventLoop * | loop | ) | const |
Constructs an event instance around the Miscellaneous 2 button's digital signal.
| loop | the event loop instance to attach the event to. |
| BooleanEvent wpi::Gamepad::Misc3 | ( | EventLoop * | loop | ) | const |
Constructs an event instance around the Miscellaneous 3 button's digital signal.
| loop | the event loop instance to attach the event to. |
| BooleanEvent wpi::Gamepad::Misc4 | ( | EventLoop * | loop | ) | const |
Constructs an event instance around the Miscellaneous 4 button's digital signal.
| loop | the event loop instance to attach the event to. |
| BooleanEvent wpi::Gamepad::Misc5 | ( | EventLoop * | loop | ) | const |
Constructs an event instance around the Miscellaneous 5 button's digital signal.
| loop | the event loop instance to attach the event to. |
| BooleanEvent wpi::Gamepad::Misc6 | ( | EventLoop * | loop | ) | const |
Constructs an event instance around the Miscellaneous 6 button's digital signal.
| loop | the event loop instance to attach the event to. |
| BooleanEvent wpi::Gamepad::NorthFace | ( | EventLoop * | loop | ) | const |
Constructs an event instance around the North Face button's digital signal.
| loop | the event loop instance to attach the event to. |
| BooleanEvent wpi::Gamepad::RightBumper | ( | EventLoop * | loop | ) | const |
Constructs an event instance around the right bumper button's digital signal.
| loop | the event loop instance to attach the event to. |
| BooleanEvent wpi::Gamepad::RightPaddle1 | ( | EventLoop * | loop | ) | const |
Constructs an event instance around the Right Paddle 1 button's digital signal.
| loop | the event loop instance to attach the event to. |
| BooleanEvent wpi::Gamepad::RightPaddle2 | ( | EventLoop * | loop | ) | const |
Constructs an event instance around the Right Paddle 2 button's digital signal.
| loop | the event loop instance to attach the event to. |
| BooleanEvent wpi::Gamepad::RightStick | ( | EventLoop * | loop | ) | const |
Constructs an event instance around the right stick button's digital signal.
| loop | the event loop instance to attach the event to. |
| BooleanEvent wpi::Gamepad::RightTrigger | ( | double | threshold, |
| EventLoop * | loop ) const |
Constructs an event instance around the axis value of the right trigger.
The returned trigger will be true when the axis value is greater than threshold.
| threshold | the minimum axis value for the returned event to be true. This value should be in the range [0, 1] where 0 is the unpressed state of the axis. |
| loop | the event loop instance to attach the event to. |
| BooleanEvent wpi::Gamepad::RightTrigger | ( | EventLoop * | loop | ) | const |
Constructs an event instance around the axis value of the right trigger.
The returned trigger will be true when the axis value is greater than 0.5.
| loop | the event loop instance to attach the event to. |
| BooleanEvent wpi::Gamepad::SouthFace | ( | EventLoop * | loop | ) | const |
Constructs an event instance around the South Face button's digital signal.
| loop | the event loop instance to attach the event to. |
| BooleanEvent wpi::Gamepad::Start | ( | EventLoop * | loop | ) | const |
Constructs an event instance around the Start button's digital signal.
| loop | the event loop instance to attach the event to. |
| BooleanEvent wpi::Gamepad::Touchpad | ( | EventLoop * | loop | ) | const |
Constructs an event instance around the Touchpad button's digital signal.
| loop | the event loop instance to attach the event to. |
| BooleanEvent wpi::Gamepad::WestFace | ( | EventLoop * | loop | ) | const |
Constructs an event instance around the West Face button's digital signal.
| loop | the event loop instance to attach the event to. |