From: Philip Zander Date: Sat, 29 Jan 2022 21:36:40 +0000 (+0100) Subject: gdkkeys-win32: Ignore CTRL bit for key translation X-Git-Tag: archive/raspbian/4.6.5+ds-1+rpi1~1^2~19^2~4^2~32^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=90ab8b8dd3133fdc29988979b96408867237ad3b;p=gtk4.git gdkkeys-win32: Ignore CTRL bit for key translation Some keymaps on Windows contain bogus mappings for Ctrl+key for certain keys, e.g. Ctrl+Backspace = Delete, or Ctrl+[ = 0x1B. These are never used on Windows, so we should ignore them. Fixes #4667 --- diff --git a/gdk/win32/gdkkeys-win32-impl.c b/gdk/win32/gdkkeys-win32-impl.c index 2e2a382d0a..51ed1f6381 100644 --- a/gdk/win32/gdkkeys-win32-impl.c +++ b/gdk/win32/gdkkeys-win32-impl.c @@ -340,6 +340,13 @@ vk_to_char_fuzzy (GdkWin32KeymapLayoutInfo *info, if (candidate_modbits & ~mod_bits) continue; + /* Some keys have bogus mappings for the control key, e.g. + * Ctrl + Backspace = Delete, or Ctrl + [ = 0x1B. These are + * never used on Windows, so we ignore them. + */ + if (candidate_modbits == KBDCTRL) + continue; + c = entry->wch[level]; if (c == WCH_DEAD || have_sgcaps) {