summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2005-09-22 21:00:03 +0000
committerJens Arnold <amiconn@rockbox.org>2005-09-22 21:00:03 +0000
commite85fe092328de36f114875f4998fdce135338b59 (patch)
treea51005f8a3b05257515695bc8b50fa3437182d5d
parentdebbe9747eb6eecfd79aab648212b55220922eb6 (diff)
downloadrockbox-e85fe092328de36f114875f4998fdce135338b59.tar.gz
rockbox-e85fe092328de36f114875f4998fdce135338b59.tar.bz2
rockbox-e85fe092328de36f114875f4998fdce135338b59.zip
Sudoku: (Recorders) Changed menu button to F1. (Ondio) Changed menu button to long MODE. Short MODE only toggles once; use MODE+DOWN for toggle-repeat. That won't bring up the menu if you're fast enough. Should be easy using the thumb.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7545 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/plugins/sudoku.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/apps/plugins/sudoku.c b/apps/plugins/sudoku.c
index e6fdece7ef..a44c39aa45 100644
--- a/apps/plugins/sudoku.c
+++ b/apps/plugins/sudoku.c
@@ -69,12 +69,15 @@ Example ".ss" file, and one with a saved state:
#if CONFIG_KEYPAD == RECORDER_PAD
#define SUDOKU_BUTTON_QUIT BUTTON_OFF
#define SUDOKU_BUTTON_TOGGLE BUTTON_PLAY
-#define SUDOKU_BUTTON_MENU BUTTON_F3
+#define SUDOKU_BUTTON_MENU BUTTON_F1
#elif CONFIG_KEYPAD == ONDIO_PAD
#define SUDOKU_BUTTON_QUIT BUTTON_OFF
-#define SUDOKU_BUTTON_TOGGLE BUTTON_MENU
-#define SUDOKU_BUTTON_MENU (BUTTON_MENU | BUTTON_OFF)
+#define SUDOKU_BUTTON_ALTTOGGLE (BUTTON_MENU | BUTTON_DOWN)
+#define SUDOKU_BUTTON_TOGGLE_PRE BUTTON_MENU
+#define SUDOKU_BUTTON_TOGGLE (BUTTON_MENU | BUTTON_REL)
+#define SUDOKU_BUTTON_MENU_PRE BUTTON_MENU
+#define SUDOKU_BUTTON_MENU (BUTTON_MENU | BUTTON_REPEAT)
#elif (CONFIG_KEYPAD == IRIVER_H100_PAD) || \
(CONFIG_KEYPAD == IRIVER_H300_PAD)
@@ -1058,6 +1061,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
{
bool exit;
int button;
+ int lastbutton = BUTTON_NONE;
long ticks;
struct sudoku_state_t state;
@@ -1103,6 +1107,11 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
case SUDOKU_BUTTON_ALTTOGGLE:
#endif
case SUDOKU_BUTTON_TOGGLE:
+#ifdef SUDOKU_BUTTON_TOGGLE_PRE
+ if ((button == SUDOKU_BUTTON_TOGGLE)
+ && (lastbutton != SUDOKU_BUTTON_TOGGLE_PRE))
+ break;
+#endif
/* Increment digit */
ticks=*rb->current_tick;
if (state.startboard[state.y][state.x]=='0') {
@@ -1158,6 +1167,10 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
break;
case SUDOKU_BUTTON_MENU:
+#ifdef SUDOKU_BUTTON_MENU_PRE
+ if (lastbutton != SUDOKU_BUTTON_MENU_PRE)
+ break;
+#endif
/* Don't let the user leave a game in a bad state */
if (check_status(&state)) {
rb->splash(HZ*2, true, "Illegal move!");
@@ -1177,6 +1190,8 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
}
break;
}
+ if (button != BUTTON_NONE)
+ lastbutton = button;
display_board(&state);
}