input: discard any multibyte character when <Alt> is being held

Otherwise the <Alt> key would simply be ignored.  It's better to reject
the combination, to compel the user to be precise in what they type.
master
Benno Schulenberg 2020-08-15 13:44:25 +02:00
parent 3d0bfb0a00
commit 50b61bef6f
1 changed files with 7 additions and 0 deletions

View File

@ -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;