1
0
Fork 0
forked from len0rd/rockbox

Fix chessbox keymap handling

Let's give the defined, yet unused keymaps some sense :)

Change-Id: I372217351f7edc35c69c8c29fba782d32c895d5b
This commit is contained in:
Sebastian Leonhardt 2015-04-23 00:07:27 +02:00 committed by Gerrit Rockbox
parent bc25437448
commit f01fb3ca59
2 changed files with 85 additions and 35 deletions

View file

@ -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;