From 5e91ec14011656d8952007aceb99189cd28786ba Mon Sep 17 00:00:00 2001 From: Sebastian Leonhardt Date: Sun, 27 Dec 2015 18:14:41 +0100 Subject: Samsung YH820/92x keymap bugfixes This patch fixes some (mostly small) plugin issues with the "big" YH-keymap patch (a507b). Only one fix affects the main keymaps (virtual keyboard "DONE" now exits after long key /release/ instead of long button /press/). Change-Id: Id34f925ebfa97ae4974cd9405fbe1fee4f597833 --- apps/plugins/sokoban.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'apps/plugins/sokoban.c') diff --git a/apps/plugins/sokoban.c b/apps/plugins/sokoban.c index 76eb6288cd..f085e1bff2 100644 --- a/apps/plugins/sokoban.c +++ b/apps/plugins/sokoban.c @@ -495,7 +495,8 @@ #define SOKOBAN_RIGHT BUTTON_RIGHT #define SOKOBAN_UP BUTTON_UP #define SOKOBAN_DOWN BUTTON_DOWN -#define SOKOBAN_MENU BUTTON_PLAY +#define SOKOBAN_MENU_PRE BUTTON_PLAY +#define SOKOBAN_MENU (BUTTON_PLAY | BUTTON_REL) #define SOKOBAN_UNDO BUTTON_REW #define SOKOBAN_REDO BUTTON_FFWD #define SOKOBAN_LEVEL_DOWN (BUTTON_PLAY | BUTTON_DOWN) @@ -1690,7 +1691,7 @@ static bool sokoban_loop(void) { bool moved; int i = 0, button = 0; -#if defined(SOKOBAN_UNDO_PRE) +#if defined(SOKOBAN_UNDO_PRE) || defined(SOKOBAN_MENU_PRE) int lastbutton = 0; #endif int w, h; @@ -1703,10 +1704,15 @@ static bool sokoban_loop(void) switch(button) { + case SOKOBAN_MENU: +#ifdef SOKOBAN_MENU_PRE + if (lastbutton != SOKOBAN_MENU_PRE) + break; + /* fallthrough */ +#endif #ifdef SOKOBAN_RC_MENU case SOKOBAN_RC_MENU: #endif - case SOKOBAN_MENU: switch (sokoban_menu()) { case 5: /* Quit */ case 6: /* Save & quit */ @@ -1794,7 +1800,7 @@ static bool sokoban_loop(void) return PLUGIN_USB_CONNECTED; break; } -#if defined(SOKOBAN_UNDO_PRE) +#if defined(SOKOBAN_UNDO_PRE) || defined(SOKOBAN_MENU_PRE) lastbutton = button; #endif -- cgit v1.2.3