Skip to content

Commit f10952e

Browse files
aeloxbrammool
authored andcommitted
patch 9.0.0888: MS-Windows GUI: CTRL-] does not work on Swiss keyboard
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)
1 parent a44c781 commit f10952e

2 files changed

Lines changed: 18 additions & 7 deletions

File tree

src/gui_w32.c

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2152,16 +2152,25 @@ process_message(void)
21522152

21532153
if (len <= 0)
21542154
{
2155-
if ( dead_key == DEAD_KEY_SET_DEFAULT
2156-
&& (GetKeyState(VK_CONTROL) & 0x8000)
2157-
&& ( (vk == 221 && scan_code == 26) // AZERTY CTRL+dead_circumflex
2158-
|| (vk == 220 && scan_code == 41) // QWERTZ CTRL+dead_circumflex
2159-
)
2160-
)
2155+
int wm_char = NUL;
2156+
2157+
if (dead_key == DEAD_KEY_SET_DEFAULT
2158+
&& (GetKeyState(VK_CONTROL) & 0x8000))
2159+
{
2160+
if ( // AZERTY CTRL+dead_circumflex
2161+
(vk == 221 && scan_code == 26)
2162+
// QWERTZ CTRL+dead_circumflex
2163+
|| (vk == 220 && scan_code == 41))
2164+
wm_char = '[';
2165+
if ( // QWERTZ CTRL+dead_two-overdots
2166+
(vk == 192 && scan_code == 27))
2167+
wm_char = ']';
2168+
}
2169+
if (wm_char != NUL)
21612170
{
21622171
// post WM_CHAR='[' - which will be interpreted with CTRL
21632172
// still hold as ESC
2164-
PostMessageW(msg.hwnd, WM_CHAR, '[', msg.lParam);
2173+
PostMessageW(msg.hwnd, WM_CHAR, wm_char, msg.lParam);
21652174
// ask _OnChar() to not touch this state, wait for next key
21662175
// press and maintain knowledge that we are "poisoned" with
21672176
// "dead state"

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -695,6 +695,8 @@ static char *(features[]) =
695695

696696
static int included_patches[] =
697697
{ /* Add new patch number below this line */
698+
/**/
699+
888,
698700
/**/
699701
887,
700702
/**/

0 commit comments

Comments
 (0)