feat: Page turn button orientation change (#1069)

Co-authored-by: Егор Мартынов <martynovegorOF@yandex.ru>
This commit is contained in:
Maciek
2026-05-04 08:56:02 +03:00
committed by GitHub
co-authored by Егор Мартынов
parent b692bad10d
commit 2e2ea6a9e8
24 changed files with 99 additions and 29 deletions
+11 -3
View File
@@ -202,15 +202,14 @@ void EpubReaderActivity::loop() {
return;
}
const bool skipChapter = !fromTilt && SETTINGS.longPressChapterSkip && mappedInput.getHeldTime() > skipChapterMs;
const bool longPress = !fromTilt && mappedInput.getHeldTime() > skipChapterMs;
// Don't skip chapter after screenshot
if (gpio.wasReleased(HalGPIO::BTN_POWER) && gpio.wasReleased(HalGPIO::BTN_DOWN)) {
return;
}
if (skipChapter) {
lastPageTurnTime = millis();
if (longPress && SETTINGS.longPressButtonBehavior == SETTINGS.CHAPTER_SKIP) {
// We don't want to delete the section mid-render, so grab the semaphore
{
RenderLock lock(*this);
@@ -222,6 +221,15 @@ void EpubReaderActivity::loop() {
return;
}
if (longPress && SETTINGS.longPressButtonBehavior == SETTINGS.ORIENTATION_CHANGE) {
const uint8_t newOrientation =
nextTriggered ? (SETTINGS.orientation - 1 + SETTINGS.ORIENTATION_COUNT) % SETTINGS.ORIENTATION_COUNT
: (SETTINGS.orientation + 1) % SETTINGS.ORIENTATION_COUNT;
applyOrientation(newOrientation);
requestUpdate();
return;
}
// No current section, attempt to rerender the book
if (!section) {
requestUpdate();