summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--common/menu.c6
-rw-r--r--include/readkey.h4
2 files changed, 7 insertions, 3 deletions
diff --git a/common/menu.c b/common/menu.c
index 5291fcb..fd21e52 100644
--- a/common/menu.c
+++ b/common/menu.c
@@ -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);
diff --git a/include/readkey.h b/include/readkey.h
index aabb835..f134846 100644
--- a/include/readkey.h
+++ b/include/readkey.h
@@ -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 */