summaryrefslogtreecommitdiff
path: root/apps/plugins/puzzles/rockbox.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/puzzles/rockbox.c')
-rw-r--r--apps/plugins/puzzles/rockbox.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/apps/plugins/puzzles/rockbox.c b/apps/plugins/puzzles/rockbox.c
index 1982da8e3e..e681db3c16 100644
--- a/apps/plugins/puzzles/rockbox.c
+++ b/apps/plugins/puzzles/rockbox.c
@@ -1506,25 +1506,25 @@ static void send_click(int button, bool release)
1506 1506
1507static int choose_key(void) 1507static int choose_key(void)
1508{ 1508{
1509 char *game_keys = NULL; 1509 int options = 0;
1510 1510
1511 const game *gm = midend_which_game(me); 1511 key_label *game_keys = midend_request_keys(me, &options);
1512 if(gm->request_keys)
1513 game_keys = gm->request_keys(midend_get_params(me));
1514 1512
1515 if(!game_keys) 1513 if(!game_keys || !options)
1516 return; 1514 return 0;
1517 1515
1518 int options = strlen(game_keys);
1519 int sel = 0; 1516 int sel = 0;
1520 1517
1521 while(1) 1518 while(1)
1522 { 1519 {
1523 midend_process_key(me, 0, 0, game_keys[sel]); 1520 if(timer_on)
1521 timer_cb();
1522 midend_process_key(me, 0, 0, game_keys[sel].button);
1524 midend_redraw(me); 1523 midend_redraw(me);
1525 rb->lcd_update(); 1524 rb->lcd_update();
1525 rb->yield();
1526 1526
1527 int button = rb->button_get(true); 1527 int button = rb->button_get_w_tmo(timer_on ? TIMER_INTERVAL : -1);
1528 switch(button) 1528 switch(button)
1529 { 1529 {
1530 case BTN_LEFT: 1530 case BTN_LEFT:
@@ -1538,11 +1538,9 @@ static int choose_key(void)
1538 case BTN_PAUSE: 1538 case BTN_PAUSE:
1539 return -1; 1539 return -1;
1540 case BTN_FIRE: 1540 case BTN_FIRE:
1541 midend_force_redraw(me); 1541 free_keys(game_keys, options);
1542 rb->lcd_update();
1543 free(game_keys);
1544 1542
1545 /* the key has already been sent to the game */ 1543 /* the key has already been sent to the game, just return */
1546 return 0; 1544 return 0;
1547 } 1545 }
1548 } 1546 }