Tracks changes in gamepad input between frames.
More...
#include <gamepad_input_tracker.h>
|
| const State & | raw () const noexcept |
| | Get the current input state.
|
| |
| void | Reset () noexcept |
| | Reset tracker state to neutral.
|
| |
| void | Tick () noexcept |
| | Advance to next frame (swap states).
|
| |
| void | Update (State state) noexcept |
| | Update current frame input state.
|
| |
| bool | pressed (Button button) const noexcept |
| | Detect button press (falling edge).
|
| |
| bool | released (Button button) const noexcept |
| | Detect button release (rising edge).
|
| |
| bool | holding (Button button) const noexcept |
| | Detect button hold.
|
| |
| bool | AxisChanged (Axis axis, uint8_t threshold) const noexcept |
| | Detect axis movement.
|
| |
| bool | operator[] (Button button) const noexcept |
| | Check if a button is pressed.
|
| |
| uint8_t | operator[] (Axis axis) const noexcept |
| | Get axis value.
|
| |
| uint32_t | button_mask () const noexcept |
| | Get button mask.
|
| |
Tracks changes in gamepad input between frames.
Useful for detecting button press, release, hold, and significant axis movement.
- Examples
- gamepad_input_tracker.ino.
Definition at line 24 of file gamepad_input_tracker.h.
◆ AxisChanged()
| bool gamepad::input::Tracker::AxisChanged |
( |
Axis | axis, |
|
|
uint8_t | threshold ) const |
|
inlinenoexcept |
Detect axis movement.
- Parameters
-
| threshold | Threshold for detecting axis movement |
- Returns
- True if axis has moved
Definition at line 117 of file gamepad_input_tracker.h.
◆ button_mask()
| uint32_t gamepad::input::Tracker::button_mask |
( |
| ) |
const |
|
inlinenoexcept |
◆ holding()
| bool gamepad::input::Tracker::holding |
( |
Button | button | ) |
const |
|
inlinenoexcept |
◆ operator[]() [1/2]
| uint8_t gamepad::input::Tracker::operator[] |
( |
Axis | axis | ) |
const |
|
inlinenoexcept |
◆ operator[]() [2/2]
| bool gamepad::input::Tracker::operator[] |
( |
Button | button | ) |
const |
|
inlinenoexcept |
◆ pressed()
| bool gamepad::input::Tracker::pressed |
( |
Button | button | ) |
const |
|
inlinenoexcept |
◆ raw()
| const State & gamepad::input::Tracker::raw |
( |
| ) |
const |
|
inlinenoexcept |
◆ released()
| bool gamepad::input::Tracker::released |
( |
Button | button | ) |
const |
|
inlinenoexcept |
Detect button release (rising edge).
- Returns
- True if button is released
Definition at line 91 of file gamepad_input_tracker.h.
◆ Reset()
| void gamepad::input::Tracker::Reset |
( |
| ) |
|
|
inlinenoexcept |
◆ Tick()
| void gamepad::input::Tracker::Tick |
( |
| ) |
|
|
inlinenoexcept |
◆ Update()
| void gamepad::input::Tracker::Update |
( |
State | state | ) |
|
|
inlinenoexcept |
The documentation for this class was generated from the following file: