Amend long press behaviour

This commit is contained in:
jpirnay
2026-04-30 11:08:42 +02:00
parent 0366f8ece8
commit da7ad888c7
2 changed files with 5 additions and 1 deletions
+4
View File
@@ -86,6 +86,10 @@ void ButtonEventManager::processButton(const int idx, const Button btn) {
pushEvent(btn, PressType::Short);
s.state = State::Idle;
}
} else if (held && now - s.pressDownTime >= LONG_PRESS_MS) {
// Fire long press immediately once the threshold is reached.
pushEvent(btn, PressType::Long);
s.state = State::Idle;
} else if (!held) {
// Button disappeared without wasReleased edge (e.g. after drain) — reset
s.state = State::Idle;