Fix power button leak on startup

This commit is contained in:
jpirnay
2026-04-08 10:14:35 +02:00
parent 84d6054898
commit b3d6562cb6
7 changed files with 57 additions and 0 deletions
@@ -48,6 +48,10 @@ int clampPercent(int percent) {
void EpubReaderActivity::onEnter() {
Activity::onEnter();
// Drop any input events that arrived from the activity that launched us (e.g. a wake-up power
// button hold) before they reach detectPageTurn() — see ReaderUtils::InputDrainGuard.
inputDrainGuard.arm();
if (!epub) {
return;
}
@@ -118,6 +122,10 @@ void EpubReaderActivity::loop() {
return;
}
if (inputDrainGuard.shouldDrain(mappedInput)) {
return;
}
if (automaticPageTurnActive) {
if (mappedInput.wasReleased(MappedInputManager::Button::Confirm) ||
mappedInput.wasReleased(MappedInputManager::Button::Back)) {