summaryrefslogtreecommitdiff
path: root/apps/plugins/chessbox/chessbox.c
diff options
context:
space:
mode:
authorSebastian Leonhardt <sebastian.leonhardt@web.de>2015-04-23 00:07:27 +0200
committerGerrit Rockbox <gerrit@rockbox.org>2015-09-30 16:13:55 +0200
commitf01fb3ca594933b6c193ee4bb23fcfbcfc72d9c8 (patch)
tree02abef65de15e593c45c31b23dfccce7349e8199 /apps/plugins/chessbox/chessbox.c
parentbc25437448c0642a8ea22e3f513ef1ca658dd737 (diff)
downloadrockbox-f01fb3ca594933b6c193ee4bb23fcfbcfc72d9c8.zip
rockbox-f01fb3ca594933b6c193ee4bb23fcfbcfc72d9c8.tar.gz
rockbox-f01fb3ca594933b6c193ee4bb23fcfbcfc72d9c8.tar.bz2
rockbox-f01fb3ca594933b6c193ee4bb23fcfbcfc72d9c8.tar.xz
Fix chessbox keymap handling
Let's give the defined, yet unused keymaps some sense :) Change-Id: I372217351f7edc35c69c8c29fba782d32c895d5b
Diffstat (limited to 'apps/plugins/chessbox/chessbox.c')
-rw-r--r--apps/plugins/chessbox/chessbox.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/apps/plugins/chessbox/chessbox.c b/apps/plugins/chessbox/chessbox.c
index 3bd9593..906cc5d 100644
--- a/apps/plugins/chessbox/chessbox.c
+++ b/apps/plugins/chessbox/chessbox.c
@@ -432,6 +432,11 @@ static struct cb_command cb_get_viewer_command (void) {
result.type = COMMAND_QUIT;
return result;
#endif
+#ifdef CB_RESTART
+ case CB_RESTART:
+ result.type = COMMAND_RESTART;
+ return result;
+#endif
case CB_MENU:
result.type = cb_menu_viewer();
return result;
@@ -575,6 +580,7 @@ static void cb_start_viewer(char* filename){
GNUChess_Initialize();
cb_drawboard();
curr_ply = selected_game->first_ply;
+ break;
case COMMAND_SELECT:
exit_game = true;
break;
@@ -659,6 +665,11 @@ static struct cb_command cb_getcommand (void) {
result.type = COMMAND_QUIT;
return result;
#endif
+#ifdef CB_RESTART
+ case CB_RESTART:
+ result.type = COMMAND_RESTART;
+ return result;
+#endif
case CB_MENU:
result.type = cb_menu();
return result;
@@ -673,6 +684,9 @@ static struct cb_command cb_getcommand (void) {
result.type = COMMAND_PLAY;
return result;
case CB_UP:
+#ifdef CB_SCROLL_UP
+ case CB_SCROLL_UP:
+#endif
if ( !from_marked ) cb_switch ( x , y );
y++;
if ( y == 8 ) {
@@ -688,6 +702,9 @@ static struct cb_command cb_getcommand (void) {
}
break;
case CB_DOWN:
+#ifdef CB_SCROLL_DOWN
+ case CB_SCROLL_DOWN:
+#endif
if ( !from_marked ) cb_switch ( x , y );
y--;
if ( y < 0 ) {
@@ -703,6 +720,9 @@ static struct cb_command cb_getcommand (void) {
}
break;
case CB_LEFT:
+#ifdef CB_SCROLL_LEFT
+ case CB_SCROLL_LEFT:
+#endif
if ( !from_marked ) cb_switch ( x , y );
x--;
if ( x < 0 ) {
@@ -718,6 +738,9 @@ static struct cb_command cb_getcommand (void) {
}
break;
case CB_RIGHT:
+#ifdef CB_SCROLL_RIGHT
+ case CB_SCROLL_RIGHT:
+#endif
if ( !from_marked ) cb_switch ( x , y );
x++;
if ( x == 8 ) {
@@ -842,13 +865,11 @@ static void cb_play_game(void) {
cb_drawboard();
}
break;
-#ifdef COMMAND_RESTART
case COMMAND_RESTART:
GNUChess_Initialize();
game = pgn_init_game();
cb_drawboard();
break;
-#endif
case COMMAND_RESUME:
cb_drawboard();
break;