#include <tap_hold.hpp>
|
| | TapHold (uint16_t hold_threshold=60) |
| |
| void | update (bool pressed, bool just_released) |
| | Call every tick with the button's current pressed state and release edge.
|
| |
| bool | tapped () |
| | True once after a short press (released before hold threshold).
|
| |
| bool | held () |
| | True once when hold threshold is reached (while still pressed).
|
| |
| bool | released_from_hold () |
| | True once when released after a hold.
|
| |
| bool | holding () const |
| | Currently in held state (pressed past threshold, not yet released).
|
| |
| uint16_t | hold_ticks () const |
| | Current tick count (0 when not pressed).
|
| |
| void | reset () |
| |
Definition at line 27 of file tap_hold.hpp.
◆ TapHold()
| sbl::components::control::TapHold::TapHold |
( |
uint16_t |
hold_threshold = 60 | ) |
|
|
inlineexplicit |
- Parameters
-
| hold_threshold | Ticks before press becomes a hold. |
Definition at line 30 of file tap_hold.hpp.
◆ held()
| bool sbl::components::control::TapHold::held |
( |
| ) |
|
|
inline |
True once when hold threshold is reached (while still pressed).
Definition at line 63 of file tap_hold.hpp.
◆ hold_ticks()
| uint16_t sbl::components::control::TapHold::hold_ticks |
( |
| ) |
const |
|
inline |
Current tick count (0 when not pressed).
Definition at line 80 of file tap_hold.hpp.
◆ holding()
| bool sbl::components::control::TapHold::holding |
( |
| ) |
const |
|
inline |
Currently in held state (pressed past threshold, not yet released).
Definition at line 77 of file tap_hold.hpp.
◆ released_from_hold()
| bool sbl::components::control::TapHold::released_from_hold |
( |
| ) |
|
|
inline |
True once when released after a hold.
Definition at line 70 of file tap_hold.hpp.
◆ reset()
| void sbl::components::control::TapHold::reset |
( |
| ) |
|
|
inline |
◆ tapped()
| bool sbl::components::control::TapHold::tapped |
( |
| ) |
|
|
inline |
True once after a short press (released before hold threshold).
Definition at line 56 of file tap_hold.hpp.
◆ update()
| void sbl::components::control::TapHold::update |
( |
bool |
pressed, |
|
|
bool |
just_released |
|
) |
| |
|
inline |
Call every tick with the button's current pressed state and release edge.
Definition at line 34 of file tap_hold.hpp.
The documentation for this class was generated from the following file: