readkey: add define for Ascii keys
this will simplify the usage of gpio keyboard Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
This commit is contained in:
parent
ef654d1617
commit
1f22d10f15
|
@ -296,7 +296,7 @@ int menu_show(struct menu *m)
|
|||
|
||||
do {
|
||||
if (m->auto_select >= 0)
|
||||
ch = '\n';
|
||||
ch = KEY_ENTER;
|
||||
else
|
||||
ch = getc();
|
||||
|
||||
|
@ -339,8 +339,8 @@ int menu_show(struct menu *m)
|
|||
m->selected->action(m, m->selected);
|
||||
print_menu_entry(m, m->selected, 1);
|
||||
break;
|
||||
case '\n':
|
||||
case '\r':
|
||||
case KEY_ENTER:
|
||||
case KEY_RETURN:
|
||||
clear();
|
||||
gotoXY(1,1);
|
||||
m->selected->action(m, m->selected);
|
||||
|
|
|
@ -3,6 +3,10 @@
|
|||
|
||||
#define CTL_CH(c) ((c) - 'a' + 1)
|
||||
|
||||
/* Ascii keys */
|
||||
#define KEY_ENTER '\n'
|
||||
#define KEY_RETURN '\r'
|
||||
|
||||
/* Misc. non-Ascii keys */
|
||||
#define KEY_UP CTL_CH('p') /* cursor key Up */
|
||||
#define KEY_DOWN CTL_CH('n') /* cursor key Down */
|
||||
|
|
Loading…
Reference in New Issue