A couple of fixes
This commit is contained in:
@@ -113,18 +113,21 @@ inline PageTurnResult detectPageTurn(const MappedInputManager& input) {
|
||||
if (tiltNegative) {
|
||||
applyTiltAction(SETTINGS.tiltNegativeAction);
|
||||
}
|
||||
const bool prev = tiltPrev || ((SETTINGS.btnShortPageBack == BA::BTN_DEFAULT &&
|
||||
!globalButtonEvents().hasDoubleAction(MappedInputManager::Button::PageBack) &&
|
||||
input.wasReleased(MappedInputManager::Button::PageBack)) ||
|
||||
(SETTINGS.btnShortLeft == BA::BTN_DEFAULT &&
|
||||
!globalButtonEvents().hasDoubleAction(MappedInputManager::Button::Left) &&
|
||||
input.wasReleased(MappedInputManager::Button::Left)));
|
||||
const bool next = tiltNext || ((SETTINGS.btnShortPageForward == BA::BTN_DEFAULT &&
|
||||
!globalButtonEvents().hasDoubleAction(MappedInputManager::Button::PageForward) &&
|
||||
input.wasReleased(MappedInputManager::Button::PageForward)) ||
|
||||
(SETTINGS.btnShortRight == BA::BTN_DEFAULT &&
|
||||
!globalButtonEvents().hasDoubleAction(MappedInputManager::Button::Right) &&
|
||||
input.wasReleased(MappedInputManager::Button::Right)));
|
||||
const bool prevButtonReleased = (SETTINGS.btnShortPageBack == BA::BTN_DEFAULT &&
|
||||
!globalButtonEvents().hasDoubleAction(MappedInputManager::Button::PageBack) &&
|
||||
input.wasReleased(MappedInputManager::Button::PageBack)) ||
|
||||
(SETTINGS.btnShortLeft == BA::BTN_DEFAULT &&
|
||||
!globalButtonEvents().hasDoubleAction(MappedInputManager::Button::Left) &&
|
||||
input.wasReleased(MappedInputManager::Button::Left));
|
||||
const bool nextButtonReleased = (SETTINGS.btnShortPageForward == BA::BTN_DEFAULT &&
|
||||
!globalButtonEvents().hasDoubleAction(MappedInputManager::Button::PageForward) &&
|
||||
input.wasReleased(MappedInputManager::Button::PageForward)) ||
|
||||
(SETTINGS.btnShortRight == BA::BTN_DEFAULT &&
|
||||
!globalButtonEvents().hasDoubleAction(MappedInputManager::Button::Right) &&
|
||||
input.wasReleased(MappedInputManager::Button::Right));
|
||||
|
||||
const bool prev = tiltPrev || prevButtonReleased;
|
||||
const bool next = tiltNext || nextButtonReleased;
|
||||
return {prev, next};
|
||||
}
|
||||
|
||||
|
||||
@@ -140,7 +140,13 @@ void TxtReaderActivity::onExit() {
|
||||
}
|
||||
|
||||
void TxtReaderActivity::loop() {
|
||||
if (inputDrainGuard.shouldDrain(mappedInput)) {
|
||||
const bool drainActive = inputDrainGuard.shouldDrain(mappedInput);
|
||||
if (!drainActive && drainWasActive) {
|
||||
halTiltSensor.clearPendingEvents();
|
||||
}
|
||||
drainWasActive = drainActive;
|
||||
|
||||
if (drainActive) {
|
||||
buttonEvents.drain();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ class TxtReaderActivity final : public Activity {
|
||||
int totalPages = 1;
|
||||
int pagesUntilFullRefresh = 0;
|
||||
ReaderUtils::InputDrainGuard inputDrainGuard;
|
||||
bool drainWasActive = false;
|
||||
|
||||
// Bookmarks (starred pages)
|
||||
BookmarkStore bookmarkStore;
|
||||
|
||||
Reference in New Issue
Block a user