diff --git a/usermods/usermod_v2_four_line_display_ALT/usermod_v2_four_line_display_ALT.h b/usermods/usermod_v2_four_line_display_ALT/usermod_v2_four_line_display_ALT.h index 5a99c3cd..48dab8f0 100644 --- a/usermods/usermod_v2_four_line_display_ALT/usermod_v2_four_line_display_ALT.h +++ b/usermods/usermod_v2_four_line_display_ALT/usermod_v2_four_line_display_ALT.h @@ -1081,7 +1081,7 @@ bool FourLineDisplayUsermod::handleButton(uint8_t b) { static bool buttonLongPressed = false; static unsigned long buttonPressedTime = 0; static unsigned long buttonWaitTime = 0; - bool handled = true; + bool handled = false; //momentary button logic if (isButtonPressed(b)) { //pressed @@ -1090,11 +1090,12 @@ bool FourLineDisplayUsermod::handleButton(uint8_t b) { buttonPressedBefore = true; if (now - buttonPressedTime > 600) { //long press - buttonLongPressed = true; //TODO: handleButton() handles button 0 without preset in a different way for double click //so we need to override with same behaviour - longPressAction(0); - //handled = false; + //DEBUG_PRINTLN(F("4LD action.")); + //if (!buttonLongPressed) longPressAction(0); + buttonLongPressed = true; + return false; } } else if (!isButtonPressed(b) && buttonPressedBefore) { //released @@ -1126,7 +1127,7 @@ bool FourLineDisplayUsermod::handleButton(uint8_t b) { buttonWaitTime = 0; //TODO: handleButton() handles button 0 without preset in a different way for double click //so we need to override with same behaviour - shortPressAction(0); + //shortPressAction(0); //handled = false; } return handled; diff --git a/wled00/button.cpp b/wled00/button.cpp index d45274a6..4d43fb5b 100644 --- a/wled00/button.cpp +++ b/wled00/button.cpp @@ -262,7 +262,7 @@ void handleButton() shortPressAction(b); buttonPressedBefore[b] = true; buttonPressedTime[b] = now; // continually update (for debouncing to work in release handler) - return; + continue; } if (!buttonPressedBefore[b]) buttonPressedTime[b] = now; @@ -283,7 +283,7 @@ void handleButton() // released after rising-edge short press action if (macroButton[b] && macroButton[b] == macroLongPress[b] && macroButton[b] == macroDoublePress[b]) { if (dur > WLED_DEBOUNCE_THRESHOLD) buttonPressedBefore[b] = false; // debounce, blocks button for 50 ms once it has been released - return; + continue; } if (dur < WLED_DEBOUNCE_THRESHOLD) {buttonPressedBefore[b] = false; continue;} // too short "press", debounce