|
GamepadInput Arduino Lib 1.2.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 | buttons {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 40 of file gamepad_input_state.h.
|
inlinenoexcept |
Release a button.
Definition at line 103 of file gamepad_input_state.h.
|
inlinestaticnoexcept |
Construct a State from raw memory.
| data | Pointer to input data |
Definition at line 54 of file gamepad_input_state.h.
|
inlinenoexcept |
Access analog axis value (const).
Definition at line 123 of file gamepad_input_state.h.
|
inlinenoexcept |
Access analog axis value.
Definition at line 113 of file gamepad_input_state.h.
|
inlinenoexcept |
Check if a button is pressed.
Definition at line 83 of file gamepad_input_state.h.
|
inlinenoexcept |
Reset all inputs to neutral state.
Definition at line 68 of file gamepad_input_state.h.
|
inlinenoexcept |
Press a button.
Definition at line 93 of file gamepad_input_state.h.
| uint8_t gamepad::input::State::axes[kAxisCount] {kAxisCenter, kAxisCenter, kAxisCenter, kAxisCenter} |
Definition at line 42 of file gamepad_input_state.h.
| uint32_t gamepad::input::State::buttons {0} |
Definition at line 41 of file gamepad_input_state.h.