summaryrefslogtreecommitdiff
path: root/apps/plugins/sokoban.c
diff options
context:
space:
mode:
authorSebastian Leonhardt <sebastian.leonhardt@web.de>2015-12-27 18:14:41 +0100
committerSebastian Leonhardt <sebastian.leonhardt@web.de>2015-12-27 18:14:41 +0100
commit5e91ec14011656d8952007aceb99189cd28786ba (patch)
tree6e0d8a4850f5f7ec85f01bf599e840c25659881f /apps/plugins/sokoban.c
parentad65f8cc71bfe9e98936d5f781263850a9d50cc0 (diff)
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
Diffstat (limited to 'apps/plugins/sokoban.c')
-rw-r--r--apps/plugins/sokoban.c14
1 files changed, 10 insertions, 4 deletions
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