From faa2cb99429214de745bbc3e64e48a7432db51ae Mon Sep 17 00:00:00 2001 From: Christian Soffke Date: Sun, 18 Dec 2022 21:13:15 +0100 Subject: plugins: Improve usability of iPod keymaps - Reduce need to press multiple buttons at the same time to quit a plugin - Have "Menu" be default way to quit plugins or to access plugin menu - Fall back to (Long) "Select" or Long "Menu" in cases where Menu button isn't available (e.g. in ImageViewer and many games) out of scope: boomshine, lua_scripts, Rockpaint, Doom, Duke3D, Pacbox, Quake, Sgt-Puzzles, Wolf3D, XWorld, Minesweeper, Pixel Painter, Spacerocks Change-Id: I6d4dc7174695fe4b8ee9cbaccb21bdbfe6af5c48 --- apps/plugins/maze.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'apps/plugins/maze.c') diff --git a/apps/plugins/maze.c b/apps/plugins/maze.c index 8c951ebdcc..ebb83ab15c 100644 --- a/apps/plugins/maze.c +++ b/apps/plugins/maze.c @@ -37,11 +37,14 @@ /* key assignments */ -#if (CONFIG_KEYPAD == IPOD_3G_PAD) +#if (CONFIG_KEYPAD == IPOD_1G2G_PAD) \ + || (CONFIG_KEYPAD == IPOD_3G_PAD) \ + || (CONFIG_KEYPAD == IPOD_4G_PAD) # define MAZE_NEW (BUTTON_SELECT | BUTTON_REPEAT) # define MAZE_NEW_PRE BUTTON_SELECT # define MAZE_QUIT BUTTON_MENU -# define MAZE_SOLVE (BUTTON_SELECT | BUTTON_PLAY) +# define MAZE_SOLVE (BUTTON_SELECT | BUTTON_REL) +# define MAZE_SOLVE_PRE BUTTON_SELECT # define MAZE_RIGHT BUTTON_RIGHT # define MAZE_RIGHT_REPEAT BUTTON_RIGHT|BUTTON_REPEAT # define MAZE_LEFT BUTTON_LEFT @@ -491,7 +494,7 @@ static void maze_move_player_left(struct maze* maze) enum plugin_status plugin_start(const void* parameter) { int button; -#ifdef MAZE_NEW_PRE +#if defined(MAZE_NEW_PRE) || defined(MAZE_SOLVE_PRE) int lastbutton = BUTTON_NONE; #endif int quit = 0; @@ -544,6 +547,10 @@ enum plugin_status plugin_start(const void* parameter) maze_draw(&maze, rb->screens[i]); break; case MAZE_SOLVE: +#ifdef MAZE_SOLVE_PRE + if(lastbutton != MAZE_SOLVE_PRE) + break; +#endif maze_solve(&maze); FOR_NB_SCREENS(i) maze_draw(&maze, rb->screens[i]); @@ -583,7 +590,7 @@ enum plugin_status plugin_start(const void* parameter) } break; } -#ifdef MAZE_NEW_PRE +#if defined(MAZE_NEW_PRE) || defined(MAZE_SOLVE_PRE) if( button != BUTTON_NONE ) lastbutton = button; #endif -- cgit v1.2.3