diff --git a/src/OneButton.cpp b/src/OneButton.cpp index 21a43c5..ad337e0 100644 --- a/src/OneButton.cpp +++ b/src/OneButton.cpp @@ -244,7 +244,7 @@ void OneButton::tick(bool activeLevel) _newState(OneButton::OCS_UP); _startTime = now; // remember starting time - } else if (waitTime > _press_ms) { + } else if ((activeLevel) && (waitTime > _press_ms)) { if (_longPressStartFunc) _longPressStartFunc(); if (_paramLongPressStartFunc) _paramLongPressStartFunc(_longPressStartFuncParam); _newState(OneButton::OCS_PRESS);