mirror of
https://github.com/daveallie/crosspoint-reader.git
synced 2026-02-05 07:07:38 +03:00
Don't change pages during skipping delay
This commit is contained in:
parent
344f675233
commit
92337be649
@ -179,7 +179,7 @@ void EpubReaderActivity::loop() {
|
||||
delayedSkipDir = nextPressed ? +1 : -1;
|
||||
delayedSkipExecuteAtMs = millis() + 500;
|
||||
xSemaphoreGive(renderingMutex);
|
||||
// Block release-based page change until unpressed
|
||||
// Block changing page until unpressed skip button
|
||||
awaitingReleaseAfterSkip = true;
|
||||
return;
|
||||
}
|
||||
@ -191,6 +191,10 @@ void EpubReaderActivity::loop() {
|
||||
mappedInput.wasReleased(MappedInputManager::Button::Power)) ||
|
||||
mappedInput.wasReleased(MappedInputManager::Button::Right);
|
||||
|
||||
if (delayedSkipPending) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!prevReleased && !nextReleased) {
|
||||
return;
|
||||
}
|
||||
@ -252,7 +256,6 @@ void EpubReaderActivity::displayTaskLoop() {
|
||||
renderScreen();
|
||||
xSemaphoreGive(renderingMutex);
|
||||
} else if (delayedSkipPending && now >= delayedSkipExecuteAtMs) {
|
||||
// Execute the delayed chapter skip now
|
||||
xSemaphoreTake(renderingMutex, portMAX_DELAY);
|
||||
nextPageNumber = 0;
|
||||
currentSpineIndex += delayedSkipDir;
|
||||
|
||||
@ -128,7 +128,7 @@ void XtcReaderActivity::loop() {
|
||||
delayedSkipAmount = 10; // long-press skip amount
|
||||
delayedSkipExecuteAtMs = millis() + 500;
|
||||
xSemaphoreGive(renderingMutex);
|
||||
// Block release-based page change until unpressed
|
||||
// Block changing page until unpressed skip button
|
||||
awaitingReleaseAfterSkip = true;
|
||||
return;
|
||||
}
|
||||
@ -140,6 +140,10 @@ void XtcReaderActivity::loop() {
|
||||
mappedInput.wasReleased(MappedInputManager::Button::Power)) ||
|
||||
mappedInput.wasReleased(MappedInputManager::Button::Right);
|
||||
|
||||
if (delayedSkipPending) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!prevReleased && !nextReleased) {
|
||||
return;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user