Tells a tap from a hold on a debounced button.
More...
Tells a tap from a hold on a debounced button.
Definition at line 32 of file tap_hold.hpp.
#include <tap_hold.hpp>
◆ TapHold()
| sbl::control::input::TapHold::TapHold |
( |
uint32_t |
hold_ticks | ) |
|
|
inlineexplicit |
- Parameters
-
| hold_ticks | How long a press lasts before it is a hold, in ticks. |
Definition at line 35 of file tap_hold.hpp.
◆ update()
| void sbl::control::input::TapHold::update |
( |
bool |
pressed, |
|
|
bool |
just_released, |
|
|
uint32_t |
elapsed_ticks |
|
) |
| |
|
inline |
- Parameters
-
| pressed | the button's debounced state |
| just_released | its release edge |
| elapsed_ticks | ticks since the previous update |
Definition at line 42 of file tap_hold.hpp.
◆ tapped()
| bool sbl::control::input::TapHold::tapped |
( |
| ) |
|
|
inline |
True once after a short press (released before the hold time).
Definition at line 70 of file tap_hold.hpp.
◆ held()
| bool sbl::control::input::TapHold::held |
( |
| ) |
|
|
inline |
True once when the hold time is reached, while still pressed.
Definition at line 77 of file tap_hold.hpp.
◆ released_from_hold()
| bool sbl::control::input::TapHold::released_from_hold |
( |
| ) |
|
|
inline |
True once when released after a hold.
Definition at line 84 of file tap_hold.hpp.
◆ holding()
| bool sbl::control::input::TapHold::holding |
( |
| ) |
const |
|
inline |
Pressed past the hold time and not yet released.
Definition at line 91 of file tap_hold.hpp.
◆ pressed_ticks()
| uint32_t sbl::control::input::TapHold::pressed_ticks |
( |
| ) |
const |
|
inline |
Ticks since the press was first seen; 0 when not pressed.
Definition at line 94 of file tap_hold.hpp.
◆ reset()
| void sbl::control::input::TapHold::reset |
( |
| ) |
|
|
inline |
The documentation for this class was generated from the following file: