From 50b61bef6f41778b0e42796e618820ac228a219a Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Sat, 15 Aug 2020 13:44:25 +0200 Subject: [PATCH] input: discard any multibyte character when is being held Otherwise the key would simply be ignored. It's better to reject the combination, to compel the user to be precise in what they type. --- src/winio.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/winio.c b/src/winio.c index afef1d4c..715be3c0 100644 --- a/src/winio.c +++ b/src/winio.c @@ -938,6 +938,13 @@ int parse_kbinput(WINDOW *win) else if (keycode == KEY_BACKSPACE || keycode == '\b' || keycode == DEL_CODE) return CONTROL_SHIFT_DELETE; +#endif +#ifdef ENABLE_UTF8 + else if (0xC0 <= keycode && keycode <= 0xFF && using_utf8()) { + while (key_buffer_len > 0 && 0x80 <= *key_buffer && *key_buffer <= 0xBF) + get_input(NULL); + return FOREIGN_SEQUENCE; + } #endif else if (!solitary && keycode < 0x20) meta_key = TRUE;