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;
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:
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;
break;
case DesktopMainEventOpenFavoritePrimary:
@@ -178,6 +191,7 @@ bool desktop_scene_main_on_event(void* context, SceneManagerEvent event) {
if(status != LoaderStatusOk) {
FURI_LOG_E(TAG, "loader_start failed: %d", status);
}
consumed = true;
break;
}
case DesktopMainEventOpen2048: {
@@ -186,6 +200,7 @@ bool desktop_scene_main_on_event(void* context, SceneManagerEvent event) {
if(status != LoaderStatusOk) {
FURI_LOG_E(TAG, "loader_start failed: %d", status);
}
consumed = true;
break;
}
case DesktopMainEventOpenZombiez: {
@@ -194,6 +209,7 @@ bool desktop_scene_main_on_event(void* context, SceneManagerEvent event) {
if(status != LoaderStatusOk) {
FURI_LOG_E(TAG, "loader_start failed: %d", status);
}
consumed = true;
break;
}
case DesktopMainEventOpenTetris: {
@@ -202,6 +218,7 @@ bool desktop_scene_main_on_event(void* context, SceneManagerEvent event) {
if(status != LoaderStatusOk) {
FURI_LOG_E(TAG, "loader_start failed: %d", status);
}
consumed = true;
break;
}
case DesktopMainEventOpenDOOM: {
@@ -210,6 +227,7 @@ bool desktop_scene_main_on_event(void* context, SceneManagerEvent event) {
if(status != LoaderStatusOk) {
FURI_LOG_E(TAG, "loader_start failed: %d", status);
}
consumed = true;
break;
}
case DesktopMainEventOpenDice: {
@@ -218,6 +236,7 @@ bool desktop_scene_main_on_event(void* context, SceneManagerEvent event) {
if(status != LoaderStatusOk) {
FURI_LOG_E(TAG, "loader_start failed: %d", status);
}
consumed = true;
break;
}
case DesktopLockedEventUpdate:

View File

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

View File

@@ -69,7 +69,7 @@ bool desktop_main_input_callback(InputEvent* event, void* context) {
} else if(event->key == InputKeyDown) {
main_view->callback(DesktopMainEventOpenArchive, main_view->context);
} 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) {
// Right key is handled by animation manager
// GOES TO PASSPORT NO MATTER WHAT
@@ -80,11 +80,11 @@ bool desktop_main_input_callback(InputEvent* event, void* context) {
if(event->key == InputKeyOk) {
main_view->callback(DesktopAnimationEventNewIdleAnimation, main_view->context);
} 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) {
main_view->callback(DesktopMainEventOpenZombiez, main_view->context); // OPENS Zombiez
} else if(event->key == InputKeyLeft) {
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) {
@@ -97,7 +97,7 @@ bool desktop_main_input_callback(InputEvent* event, void* context) {
// PREFER TO OPEN GAMES MENU
main_view->callback(DesktopMainEventOpen2048, main_view->context); // OPENS 2048
} 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) {
if(event->key == InputKeyOk) {
@@ -110,7 +110,7 @@ bool desktop_main_input_callback(InputEvent* event, void* context) {
main_view->callback(DesktopMainEventOpenTetris, main_view->context); // OPENS TETRIS
}
}
} else {
} else {
if(event->type == InputTypeShort) {
if(event->key == InputKeyOk) {
main_view->callback(DesktopMainEventOpenDice, main_view->context); // OPENS Dice
@@ -119,7 +119,7 @@ bool desktop_main_input_callback(InputEvent* event, void* context) {
} else if(event->key == InputKeyDown) {
main_view->callback(DesktopMainEventOpen2048, main_view->context); // OPENS 2048
} 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) {
if(event->key == InputKeyOk) {
@@ -127,12 +127,12 @@ bool desktop_main_input_callback(InputEvent* event, void* context) {
} else if(event->key == InputKeyUp) {
main_view->callback(DesktopMainEventOpenSnake, main_view->context); // OPENS SNAKE
} 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) {
main_view->callback(DesktopMainEventOpenClock, main_view->context);
main_view->callback(DesktopMainEventOpenTetris, main_view->context); // OPENS TETRIS
}
}
}
}
if(event->key == InputKeyBack) {
if(event->type == InputTypePress) {