diff options
author | Aedin Louis Xavier <mmxael@gmail.com> | 2022-11-16 12:02:28 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-11-16 12:02:28 +0000 |
commit | f10952e8c0b94bae58742f147d6779998d189892 (patch) | |
tree | e1590d406013431ec29ea4e44a8cf8106801cb75 /src/gui_w32.c | |
parent | a44c7811ff1c5519ac9acd6a34c58c98366f5c5f (diff) |
patch 9.0.0888: MS-Windows GUI: CTRL-] does not work on Swiss keyboardv9.0.0888
Problem: MS-Windows GUI: CTRL-] does not work on Swiss keyboard.
Solution: Check the key code and don't consider it as a dead key. (Aedin
Louis Xavier, closes #11556)
Diffstat (limited to 'src/gui_w32.c')
-rw-r--r-- | src/gui_w32.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/src/gui_w32.c b/src/gui_w32.c index 9399c930ec..6733ac0624 100644 --- a/src/gui_w32.c +++ b/src/gui_w32.c @@ -2152,16 +2152,25 @@ process_message(void) if (len <= 0) { - if ( dead_key == DEAD_KEY_SET_DEFAULT - && (GetKeyState(VK_CONTROL) & 0x8000) - && ( (vk == 221 && scan_code == 26) // AZERTY CTRL+dead_circumflex - || (vk == 220 && scan_code == 41) // QWERTZ CTRL+dead_circumflex - ) - ) + int wm_char = NUL; + + if (dead_key == DEAD_KEY_SET_DEFAULT + && (GetKeyState(VK_CONTROL) & 0x8000)) + { + if ( // AZERTY CTRL+dead_circumflex + (vk == 221 && scan_code == 26) + // QWERTZ CTRL+dead_circumflex + || (vk == 220 && scan_code == 41)) + wm_char = '['; + if ( // QWERTZ CTRL+dead_two-overdots + (vk == 192 && scan_code == 27)) + wm_char = ']'; + } + if (wm_char != NUL) { // post WM_CHAR='[' - which will be interpreted with CTRL // still hold as ESC - PostMessageW(msg.hwnd, WM_CHAR, '[', msg.lParam); + PostMessageW(msg.hwnd, WM_CHAR, wm_char, msg.lParam); // ask _OnChar() to not touch this state, wait for next key // press and maintain knowledge that we are "poisoned" with // "dead state" |