diff --git a/src/wininput.c b/src/wininput.c index 2e4021ce2..1819696cd 100644 --- a/src/wininput.c +++ b/src/wininput.c @@ -2334,6 +2334,14 @@ static LONG last_key_time = 0; #ifdef debug_def_keys printf("key %04X <%s>\n", *wbuf, tag); #endif + + if (wlen < 0) { + // Ugly hack to clear dead key state, a la Michael Kaplan. + memset(kbd0, 0, sizeof kbd0); + uint scancode = MapVirtualKey(VK_DECIMAL, 0); + wchar dummy; + while (ToUnicode(VK_DECIMAL, scancode, kbd0, &dummy, 1, 0) < 0); + } } if (tag) { int ret = pick_key_function(cfg.key_commands, tag, 0, key, mods, scancode); diff --git a/wiki/Changelog.md b/wiki/Changelog.md index d6ceaa475..21b531a9c 100644 --- a/wiki/Changelog.md +++ b/wiki/Changelog.md @@ -3,6 +3,7 @@ Vector graphics Keyboard handling * Cancel compose key on mouse actions, to prevent surprising character composition. + * Fixed special key assignment (Ctrl+Shift+^) spoiled by KeyFunctions (since 2.9.1). Window handling * Prevent mouse wheel double interpretation, also fixing speed issues (mintty/wsltty#238).