From f01fb3ca594933b6c193ee4bb23fcfbcfc72d9c8 Mon Sep 17 00:00:00 2001 From: Sebastian Leonhardt Date: Thu, 23 Apr 2015 00:07:27 +0200 Subject: Fix chessbox keymap handling Let's give the defined, yet unused keymaps some sense :) Change-Id: I372217351f7edc35c69c8c29fba782d32c895d5b --- apps/plugins/chessbox/chessbox.c | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) (limited to 'apps/plugins/chessbox/chessbox.c') diff --git a/apps/plugins/chessbox/chessbox.c b/apps/plugins/chessbox/chessbox.c index 3bd9593e3a..906cc5d4c8 100644 --- a/apps/plugins/chessbox/chessbox.c +++ b/apps/plugins/chessbox/chessbox.c @@ -431,6 +431,11 @@ static struct cb_command cb_get_viewer_command (void) { case CB_RC_QUIT: 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(); @@ -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; @@ -658,6 +664,11 @@ static struct cb_command cb_getcommand (void) { case CB_RC_QUIT: 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(); @@ -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; -- cgit v1.2.3