diff --git a/src/ButtonEventManager.cpp b/src/ButtonEventManager.cpp index 1741c851..f10dff48 100644 --- a/src/ButtonEventManager.cpp +++ b/src/ButtonEventManager.cpp @@ -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; diff --git a/src/ButtonEventManager.h b/src/ButtonEventManager.h index 530dc246..7d39e506 100644 --- a/src/ButtonEventManager.h +++ b/src/ButtonEventManager.h @@ -16,7 +16,7 @@ ButtonEventManager& globalButtonEvents(); // on release (zero extra wait). // - If a double-click action IS configured, Short is delayed by DOUBLE_WINDOW_MS // to allow disambiguation. -// - Long fires on release once hold time >= LONG_PRESS_MS (no extra wait). +// - Long fires as soon as hold time >= LONG_PRESS_MS; release is not required. // - Double fires on the second release within DOUBLE_WINDOW_MS. // // Activities query consumeEvent() each loop tick to receive pending events.