fix desktop button options

This commit is contained in:
RogueMaster
2022-09-18 03:32:02 -04:00
parent 2c9ea85e3d
commit 295e22da83
3 changed files with 31 additions and 11 deletions

View File

@@ -116,8 +116,21 @@ bool desktop_scene_main_on_event(void* context, SceneManagerEvent event) {
consumed = true; consumed = true;
break; break;
} }
case DesktopMainEventOpenSubRemote:
LoaderStatus status = loader_start(
desktop->loader, "Applications", EXT_PATH("/apps/Main/SubGHz_Remote.fap"));
if(status != LoaderStatusOk) {
FURI_LOG_E(TAG, "loader_start failed: %d", status);
}
consumed = true;
break;
case DesktopMainEventOpenClock: case DesktopMainEventOpenClock:
loader_start(desktop->loader, FLIPPER_APPS[0].name, NULL); // loader_start(desktop->loader, FLIPPER_APPS[0].name, NULL);
LoaderStatus status = loader_start(
desktop->loader, "Applications", EXT_PATH("/apps/Main/Clock.fap"));
if(status != LoaderStatusOk) {
FURI_LOG_E(TAG, "loader_start failed: %d", status);
}
consumed = true; consumed = true;
break; break;
case DesktopMainEventOpenFavoritePrimary: case DesktopMainEventOpenFavoritePrimary:
@@ -178,6 +191,7 @@ bool desktop_scene_main_on_event(void* context, SceneManagerEvent event) {
if(status != LoaderStatusOk) { if(status != LoaderStatusOk) {
FURI_LOG_E(TAG, "loader_start failed: %d", status); FURI_LOG_E(TAG, "loader_start failed: %d", status);
} }
consumed = true;
break; break;
} }
case DesktopMainEventOpen2048: { case DesktopMainEventOpen2048: {
@@ -186,6 +200,7 @@ bool desktop_scene_main_on_event(void* context, SceneManagerEvent event) {
if(status != LoaderStatusOk) { if(status != LoaderStatusOk) {
FURI_LOG_E(TAG, "loader_start failed: %d", status); FURI_LOG_E(TAG, "loader_start failed: %d", status);
} }
consumed = true;
break; break;
} }
case DesktopMainEventOpenZombiez: { case DesktopMainEventOpenZombiez: {
@@ -194,6 +209,7 @@ bool desktop_scene_main_on_event(void* context, SceneManagerEvent event) {
if(status != LoaderStatusOk) { if(status != LoaderStatusOk) {
FURI_LOG_E(TAG, "loader_start failed: %d", status); FURI_LOG_E(TAG, "loader_start failed: %d", status);
} }
consumed = true;
break; break;
} }
case DesktopMainEventOpenTetris: { case DesktopMainEventOpenTetris: {
@@ -202,6 +218,7 @@ bool desktop_scene_main_on_event(void* context, SceneManagerEvent event) {
if(status != LoaderStatusOk) { if(status != LoaderStatusOk) {
FURI_LOG_E(TAG, "loader_start failed: %d", status); FURI_LOG_E(TAG, "loader_start failed: %d", status);
} }
consumed = true;
break; break;
} }
case DesktopMainEventOpenDOOM: { case DesktopMainEventOpenDOOM: {
@@ -210,6 +227,7 @@ bool desktop_scene_main_on_event(void* context, SceneManagerEvent event) {
if(status != LoaderStatusOk) { if(status != LoaderStatusOk) {
FURI_LOG_E(TAG, "loader_start failed: %d", status); FURI_LOG_E(TAG, "loader_start failed: %d", status);
} }
consumed = true;
break; break;
} }
case DesktopMainEventOpenDice: { case DesktopMainEventOpenDice: {
@@ -218,6 +236,7 @@ bool desktop_scene_main_on_event(void* context, SceneManagerEvent event) {
if(status != LoaderStatusOk) { if(status != LoaderStatusOk) {
FURI_LOG_E(TAG, "loader_start failed: %d", status); FURI_LOG_E(TAG, "loader_start failed: %d", status);
} }
consumed = true;
break; break;
} }
case DesktopLockedEventUpdate: case DesktopLockedEventUpdate:

View File

@@ -18,6 +18,7 @@ typedef enum {
DesktopMainEventOpenTetris, DesktopMainEventOpenTetris,
DesktopMainEventOpenDOOM, DesktopMainEventOpenDOOM,
DesktopMainEventOpenDice, DesktopMainEventOpenDice,
DesktopMainEventOpenSubRemote,
DesktopLockedEventUnlocked, DesktopLockedEventUnlocked,
DesktopLockedEventUpdate, DesktopLockedEventUpdate,

View File

@@ -69,7 +69,7 @@ bool desktop_main_input_callback(InputEvent* event, void* context) {
} else if(event->key == InputKeyDown) { } else if(event->key == InputKeyDown) {
main_view->callback(DesktopMainEventOpenArchive, main_view->context); main_view->callback(DesktopMainEventOpenArchive, main_view->context);
} else if(event->key == InputKeyLeft) { } else if(event->key == InputKeyLeft) {
main_view->callback(DesktopMainEventOpenFavoritePrimary, main_view->context); main_view->callback(DesktopMainEventOpenClock, main_view->context); // OPENS Clock
} else if(event->key == InputKeyRight) { } else if(event->key == InputKeyRight) {
// Right key is handled by animation manager // Right key is handled by animation manager
// GOES TO PASSPORT NO MATTER WHAT // GOES TO PASSPORT NO MATTER WHAT
@@ -80,11 +80,11 @@ bool desktop_main_input_callback(InputEvent* event, void* context) {
if(event->key == InputKeyOk) { if(event->key == InputKeyOk) {
main_view->callback(DesktopAnimationEventNewIdleAnimation, main_view->context); main_view->callback(DesktopAnimationEventNewIdleAnimation, main_view->context);
} else if(event->key == InputKeyUp) { } else if(event->key == InputKeyUp) {
main_view->callback(DesktopMainEventOpenDOOM, main_view->context); // OPENS DOOM main_view->callback(DesktopMainEventOpenFavoritePrimary, main_view->context);
} else if(event->key == InputKeyDown) { } else if(event->key == InputKeyDown) {
main_view->callback(DesktopMainEventOpenZombiez, main_view->context); // OPENS Zombiez
} else if(event->key == InputKeyLeft) {
main_view->callback(DesktopMainEventOpenFavoriteSecondary, main_view->context); main_view->callback(DesktopMainEventOpenFavoriteSecondary, main_view->context);
} else if(event->key == InputKeyLeft) {
main_view->callback(DesktopMainEventOpenSubRemote, main_view->context); // OPENS SUBGHZ REMOTE
} }
} }
} else if(main_view->is_gamemode == true) { } else if(main_view->is_gamemode == true) {
@@ -97,7 +97,7 @@ bool desktop_main_input_callback(InputEvent* event, void* context) {
// PREFER TO OPEN GAMES MENU // PREFER TO OPEN GAMES MENU
main_view->callback(DesktopMainEventOpen2048, main_view->context); // OPENS 2048 main_view->callback(DesktopMainEventOpen2048, main_view->context); // OPENS 2048
} else if(event->key == InputKeyLeft) { } else if(event->key == InputKeyLeft) {
main_view->callback(DesktopMainEventOpenClock, main_view->context); main_view->callback(DesktopMainEventOpenClock, main_view->context); // OPENS CLOCK
} }
} else if(event->type == InputTypeLong) { } else if(event->type == InputTypeLong) {
if(event->key == InputKeyOk) { if(event->key == InputKeyOk) {
@@ -119,7 +119,7 @@ bool desktop_main_input_callback(InputEvent* event, void* context) {
} else if(event->key == InputKeyDown) { } else if(event->key == InputKeyDown) {
main_view->callback(DesktopMainEventOpen2048, main_view->context); // OPENS 2048 main_view->callback(DesktopMainEventOpen2048, main_view->context); // OPENS 2048
} else if(event->key == InputKeyLeft) { } else if(event->key == InputKeyLeft) {
main_view->callback(DesktopMainEventOpenPassport, main_view->context); main_view->callback(DesktopMainEventOpenClock, main_view->context); // OPENS CLOCK
} }
} else if(event->type == InputTypeLong) { } else if(event->type == InputTypeLong) {
if(event->key == InputKeyOk) { if(event->key == InputKeyOk) {
@@ -127,9 +127,9 @@ bool desktop_main_input_callback(InputEvent* event, void* context) {
} else if(event->key == InputKeyUp) { } else if(event->key == InputKeyUp) {
main_view->callback(DesktopMainEventOpenSnake, main_view->context); // OPENS SNAKE main_view->callback(DesktopMainEventOpenSnake, main_view->context); // OPENS SNAKE
} else if(event->key == InputKeyDown) { } else if(event->key == InputKeyDown) {
main_view->callback(DesktopMainEventOpenTetris, main_view->context); // OPENS TETRIS main_view->callback(DesktopMainEventOpenZombiez, main_view->context); // OPENS Zombiez
} else if(event->key == InputKeyLeft) { } else if(event->key == InputKeyLeft) {
main_view->callback(DesktopMainEventOpenClock, main_view->context); main_view->callback(DesktopMainEventOpenTetris, main_view->context); // OPENS TETRIS
} }
} }
} }