mirror of
https://github.com/ratspeak/ratdeck.git
synced 2026-07-18 17:56:12 +00:00
Long-press trackball blanks screen; suppress touch wakes when off
Two pocket-carry quality-of-life additions: 1. Long-press (1.2s) trackball click blanks the screen if no LVGL screen consumes the long-press. InputManager captures the power state at click DOWN (_clickFromScreenOn) and only emits the long-press if the screen was already on, so a long-press from SCREEN_OFF wakes without immediately re-blanking. 2. Touch events are ignored entirely while screen is off, preventing accidental wakes from pressure on the panel in a pocket/bag. Trackball click and keyboard keys still wake normally. InputManager now holds a Power* injected via setPowerMgr() in setup.
This commit is contained in:
+5
-2
@@ -435,6 +435,7 @@ void setup() {
|
||||
|
||||
// Step 10: Input manager
|
||||
inputManager.begin(&keyboard, &trackball, &touch);
|
||||
inputManager.setPowerMgr(&powerMgr);
|
||||
|
||||
// Step 10.5: LVGL input drivers
|
||||
LvInput::init(&keyboard, &trackball, &touch);
|
||||
@@ -933,9 +934,11 @@ void loop() {
|
||||
powerMgr.weakActivity(); // Trackball: wake from dim only
|
||||
}
|
||||
|
||||
// 2. Long-press dispatch
|
||||
// 2. Long-press dispatch — screen blanking is the default if no screen consumes it
|
||||
if (inputManager.hadLongPress()) {
|
||||
ui.handleLongPress();
|
||||
if (!ui.handleLongPress()) {
|
||||
powerMgr.forceScreenOff();
|
||||
}
|
||||
}
|
||||
|
||||
// 3. Key event dispatch
|
||||
|
||||
Reference in New Issue
Block a user