menu: fix support for "\n", "\n\r" and "\r"
If "\n\r" or "\r\n" is ignore one. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
This commit is contained in:
parent
76c9becdc2
commit
eb7667b681
|
@ -252,7 +252,7 @@ static void print_menu(struct menu *m)
|
|||
|
||||
int menu_show(struct menu *m)
|
||||
{
|
||||
int ch;
|
||||
int ch, ch_previous = 0;
|
||||
int escape = 0;
|
||||
int countdown;
|
||||
int auto_display_len = 16;
|
||||
|
@ -339,7 +339,12 @@ int menu_show(struct menu *m)
|
|||
m->selected->action(m, m->selected);
|
||||
print_menu_entry(m, m->selected, 1);
|
||||
break;
|
||||
case KEY_ENTER:
|
||||
if (ch_previous == KEY_RETURN)
|
||||
break;
|
||||
case KEY_RETURN:
|
||||
if (ch_previous == KEY_ENTER)
|
||||
break;
|
||||
clear();
|
||||
gotoXY(1,1);
|
||||
m->selected->action(m, m->selected);
|
||||
|
@ -350,6 +355,7 @@ int menu_show(struct menu *m)
|
|||
default:
|
||||
break;
|
||||
}
|
||||
ch_previous = ch;
|
||||
} while(1);
|
||||
|
||||
return 0;
|
||||
|
|
Loading…
Reference in New Issue