hibernation page navigation bugfix

This commit is contained in:
pelgraine
2026-05-03 23:15:32 +10:00
parent 4ba130ccfa
commit 44353fcf9e
2 changed files with 10 additions and 4 deletions

View File

@@ -1495,7 +1495,11 @@ static void lastHeardToggleContact() {
if (horizontal) {
return (dx < 0) ? (char)KEY_NEXT : (char)KEY_PREV;
}
return (char)KEY_NEXT; // vertical swipe = next (default)
// Shutdown page: vertical swipe toggles hibernate/power off
if (ui_task.isHomeOnShutdownPage()) {
return 'w'; // toggle (direction doesn't matter)
}
return (char)KEY_NEXT; // vertical swipe = next page (default)
}
// Settings: horizontal swipe → a/d for picker/number editing

View File

@@ -1115,7 +1115,9 @@ public:
return true; // eat all other keys while confirming
}
// Up/down toggles between hibernate and power off
if (c == KEY_NEXT || c == 's' || c == KEY_PREV || c == 'w') {
// Only 'w'/'s' (keyboard) — KEY_NEXT/KEY_PREV fall through to page cycling
// so touch swipes and taps can still navigate away from this page.
if (c == 'w' || c == 's') {
_poweroff_selected = !_poweroff_selected;
return true;
}
@@ -1131,11 +1133,11 @@ public:
// Left/right fall through to page cycling below
}
if (c == KEY_LEFT || c == KEY_PREV) {
if (c == KEY_LEFT || c == KEY_PREV || c == 'a') {
_page = (_page + HomePage::Count - 1) % HomePage::Count;
return true;
}
if (c == KEY_NEXT || c == KEY_RIGHT) {
if (c == KEY_NEXT || c == KEY_RIGHT || c == 'd') {
_page = (_page + 1) % HomePage::Count;
if (_page == HomePage::RECENT) {
_task->showAlert("Recent adverts", 800);