desktop: prompt to power off on back button long press (#1279)

* desktop: prompt to power off on back button long press
   Implemented by launching Power Settings app, passing "off" as arg to
   directly jump to "power off" scene.
This commit is contained in:
Kevin Wallace
2022-06-10 06:29:25 -07:00
committed by GitHub
parent b3186e29e2
commit d378ca6fda
5 changed files with 23 additions and 5 deletions

View File

@@ -8,6 +8,7 @@ typedef enum {
DesktopMainEventOpenMenu,
DesktopMainEventOpenDebug,
DesktopMainEventOpenPassport, /**< Broken, don't use it */
DesktopMainEventOpenPowerOff,
DesktopLockedEventUnlocked,
DesktopLockedEventUpdate,

View File

@@ -53,6 +53,8 @@ bool desktop_main_input(InputEvent* event, void* context) {
main_view->callback(DesktopMainEventOpenDebug, main_view->context);
} else if(event->key == InputKeyLeft) {
main_view->callback(DesktopMainEventOpenFavoriteSecondary, main_view->context);
} else if(event->key == InputKeyBack) {
main_view->callback(DesktopMainEventOpenPowerOff, main_view->context);
}
}