mirror of
https://github.com/ratspeak/ratdeck.git
synced 2026-08-28 13:34:27 +00:00
Merge pull request #32 from drkhsh/feat/power-management
Power: manual screen-off + pocket-carry input gating
This commit is contained in:
+5
-2
@@ -456,6 +456,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);
|
||||
@@ -956,9 +957,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