0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.1.2134: modifier keys are not always recognized

Problem:    Modifier keys are not always recognized.
Solution:   Handle key codes generated by xterm with modifyOtherKeys set.
            Add this to libvterm so we can debug it.
This commit is contained in:
Bram Moolenaar
2019-10-10 21:14:03 +02:00
parent 07282f01da
commit 6a0299d8f4
9 changed files with 185 additions and 65 deletions

View File

@@ -1733,6 +1733,25 @@ vgetc(void)
case K_XRIGHT: c = K_RIGHT; break;
}
if (!no_reduce_keys)
{
// A modifier was not used for a mapping, apply it to ASCII
// keys.
if ((mod_mask & MOD_MASK_CTRL)
&& ((c >= '`' && c <= 0x7f)
|| (c >= '@' && c <= '_')))
{
c &= 0x1f;
mod_mask &= ~MOD_MASK_CTRL;
}
if ((mod_mask & (MOD_MASK_META | MOD_MASK_ALT))
&& c >= 0 && c <= 127)
{
c += 0x80;
mod_mask &= ~MOD_MASK_META;
}
}
// For a multi-byte character get all the bytes and return the
// converted character.
// Note: This will loop until enough bytes are received!