diff --git a/src/util/ButtonNavigator.cpp b/src/util/ButtonNavigator.cpp index 28e6eeab..e170c86a 100644 --- a/src/util/ButtonNavigator.cpp +++ b/src/util/ButtonNavigator.cpp @@ -270,6 +270,12 @@ void ButtonNavigator::onListNav(const Buttons& buttons, const bool forward, int& return; } + const bool wasPressed = std::any_of(buttons.begin(), buttons.end(), + [](const MappedInputManager::Button b) { return mappedInput->wasPressed(b); }); + if (wasPressed) { + lastPressMs = millis(); + } + const bool wasReleased = std::any_of(buttons.begin(), buttons.end(), [](const MappedInputManager::Button b) { return mappedInput->wasReleased(b); }); if (!wasReleased) return; @@ -283,7 +289,6 @@ void ButtonNavigator::onListNav(const Buttons& buttons, const bool forward, int& const uint32_t now = millis(); const bool isDouble = (now - lastPressMs) < listDoubleClickMs; - lastPressMs = now; if (isDouble) { // Restore to position before the first press so the total movement is exactly listJumpCount. diff --git a/src/util/ButtonNavigator.h b/src/util/ButtonNavigator.h index c47adc25..8c37a96a 100644 --- a/src/util/ButtonNavigator.h +++ b/src/util/ButtonNavigator.h @@ -22,7 +22,7 @@ class ButtonNavigator final { bool longPressPreviousFired = false; int indexBeforePress = 0; - static constexpr uint16_t listDoubleClickMs = 350; + static constexpr uint16_t listDoubleClickMs = 200; static constexpr uint32_t listLongPressMs = 1500; static constexpr int listJumpCount = 10;