From c259a13d673caca062a1e2244c1d70ed60b1926c Mon Sep 17 00:00:00 2001 From: jacob Date: Wed, 24 Mar 2004 14:53:51 +0000 Subject: [PATCH] Fix from Thomas Henlich for bug in dead key support. I've reproduced the problem and verified the fix on Win2K with the US-International keyboard layout. (Closes: `win-dead-keys') <20040323143836.GA40414@rcs.urz.tu-dresden.de> git-svn-id: svn://svn.tartarus.org/sgt/putty@3963 cda61777-01e9-0310-a592-d414129be87e --- window.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/window.c b/window.c index f13f0d4f..14bedd86 100644 --- a/window.c +++ b/window.c @@ -3170,7 +3170,8 @@ static int TranslateKey(UINT message, WPARAM wParam, LPARAM lParam, HKL kbd_layout = GetKeyboardLayout(0); - static WORD keys[3]; + /* keys is for ToAsciiEx; XXX do we know how big this needs to be? */ + static BYTE keys[3]; static int compose_char = 0; static WPARAM compose_key = 0; @@ -3861,7 +3862,12 @@ static int TranslateKey(UINT message, WPARAM wParam, LPARAM lParam, keystate[VK_CAPITAL] = 0; } - r = ToAsciiEx(wParam, scan, keystate, keys, 0, kbd_layout); + /* 'keys' parameter is declared in MSDN documentation as + * 'LPWORD lpChar'. In 0.54 and below we took that to mean that + * 'keys' should be an array of WORD, but an array of BYTE works + * better on keyboard with dead keys, at least for Win2K/US- + * International and WinXP/German. Bletch. */ + r = ToAsciiEx(wParam, scan, keystate, (LPWORD)keys, 0, kbd_layout); #ifdef SHOW_TOASCII_RESULT if (r == 1 && !key_down) { if (alt_sum) { -- 2.11.0