From f66620052d4fd032652143559fc07f096a6fa635 Mon Sep 17 00:00:00 2001 From: mintsuki Date: Sun, 11 Jul 2021 02:02:50 +0200 Subject: [PATCH] Revert "readline: exclude the non-ctrl case from checks" This reverts commit 2fcabe8dfeaba00611d2d21bcb7aa5339a60cefa. --- stage23/lib/readline.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/stage23/lib/readline.c b/stage23/lib/readline.c index 26a9cdb2..ecbfac71 100644 --- a/stage23/lib/readline.c +++ b/stage23/lib/readline.c @@ -37,11 +37,11 @@ int getchar_internal(uint8_t scancode, uint8_t ascii) { return GETCHAR_ESCAPE; // special case checks for C-[pnfb] -#define CTRL_CHECK(ch, key) \ - if ((ascii | 0x60) == ch && ascii != ch) { \ - return key; \ - } else { \ - break; \ +#define CTRL_CHECK(ch, key) \ + if ((ascii | 0x60) == ch) { \ + return key; \ + } else { \ + break; \ } case 0x19: CTRL_CHECK('p', GETCHAR_CURSOR_UP); @@ -76,9 +76,10 @@ int getchar_internal(uint8_t scancode, uint8_t ascii) { return GETCHAR_ESCAPE; // special case checks for C-[pnfb] -#define CTRL_CHECK(ch, key) \ - if ((ascii | 0x60) == ch && ascii != ch) { \ - return key; \ + // EFI for some reason reports scancode zero if Ctrl is held +#define CTRL_CHECK(ch, key) \ + if ((ascii | 0x60) == ch) { \ + return key; \ } case 0: CTRL_CHECK('p', GETCHAR_CURSOR_UP);