Merge pull request #92 from ArsenArsen/trunk

readline: exclude the non-ctrl case from checks
This commit is contained in:
mint 2021-07-08 17:46:49 +02:00 committed by GitHub
commit 9f541d2d8e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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) { \
return key; \
} else { \
break; \
#define CTRL_CHECK(ch, key) \
if ((ascii | 0x60) == ch && ascii != ch) { \
return key; \
} else { \
break; \
}
case 0x19:
CTRL_CHECK('p', GETCHAR_CURSOR_UP);
@ -76,10 +76,9 @@ int getchar_internal(uint8_t scancode, uint8_t ascii) {
return GETCHAR_ESCAPE;
// special case checks for C-[pnfb]
// EFI for some reason reports scancode zero if Ctrl is held
#define CTRL_CHECK(ch, key) \
if ((ascii | 0x60) == ch) { \
return key; \
#define CTRL_CHECK(ch, key) \
if ((ascii | 0x60) == ch && ascii != ch) { \
return key; \
}
case 0:
CTRL_CHECK('p', GETCHAR_CURSOR_UP);