|
GamepadInput Arduino Lib 2.0.0
|
Represents a snapshot of gamepad input state. More...
#include <gamepad_input_state.h>
Public Member Functions | |
| void | Reset () noexcept |
| Reset all inputs to neutral state. | |
| bool | operator[] (Button button) const noexcept |
| Check if a button is pressed. | |
| void | Set (Button button) noexcept |
| Press a button. | |
| void | Clear (Button button) noexcept |
| Release a button. | |
| uint8_t & | operator[] (Axis axis) noexcept |
| Access analog axis value. | |
| const uint8_t & | operator[] (Axis axis) const noexcept |
| Access analog axis value (const). | |
Static Public Member Functions | |
| static State | FromBytes (const void *data) noexcept |
| Construct a State from raw memory. | |
Public Attributes | |
| uint32_t | button_mask {0} |
| uint8_t | axes [kAxisCount] {kAxisCenter, kAxisCenter, kAxisCenter, kAxisCenter} |
Represents a snapshot of gamepad input state.
This structure is designed to be compact and stable for serialization.
Definition at line 34 of file gamepad_input_state.h.
|
inlinenoexcept |
Release a button.
Definition at line 95 of file gamepad_input_state.h.
|
inlinestaticnoexcept |
Construct a State from raw memory.
| data | Pointer to input data |
Definition at line 48 of file gamepad_input_state.h.
|
inlinenoexcept |
Access analog axis value (const).
Definition at line 115 of file gamepad_input_state.h.
|
inlinenoexcept |
Access analog axis value.
Definition at line 105 of file gamepad_input_state.h.
|
inlinenoexcept |
Check if a button is pressed.
Definition at line 75 of file gamepad_input_state.h.
|
inlinenoexcept |
Reset all inputs to neutral state.
Definition at line 62 of file gamepad_input_state.h.
|
inlinenoexcept |
Press a button.
Definition at line 85 of file gamepad_input_state.h.
| uint8_t gamepad::input::State::axes[kAxisCount] {kAxisCenter, kAxisCenter, kAxisCenter, kAxisCenter} |
Definition at line 36 of file gamepad_input_state.h.
| uint32_t gamepad::input::State::button_mask {0} |
Definition at line 35 of file gamepad_input_state.h.