]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Another fix from Hung-Te Lin; apparently in some IMEs (such as
authorJacob Nevins <jacobn@chiark.greenend.org.uk>
Wed, 23 Mar 2005 01:08:18 +0000 (01:08 +0000)
committerJacob Nevins <jacobn@chiark.greenend.org.uk>
Wed, 23 Mar 2005 01:08:18 +0000 (01:08 +0000)
"MS NewPhonetics"), move events (arrow keys) were being doubled up,
apparently because we turned both KEYDOWN and KEYUP events into new
KEYDOWN events.

I don't claim to understand the precise effect of this patch :( but
I'm reasonably confident that it only affects IME users, and experimentally
it doesn't seem to break anything obvious, so if piaip says it makes
things better that's good enough for me :)

[originally from svn r5545]

windows/window.c

index ac54adabdf207e7a7068b4e333b4acf212867555..8448ca3429cac4e09c392a7ba331e3d73148f91e 100644 (file)
@@ -2734,13 +2734,15 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
            unsigned char buf[20];
            int len;
 
-           if (wParam == VK_PROCESSKEY) {
-               MSG m;
-               m.hwnd = hwnd;
-               m.message = WM_KEYDOWN;
-               m.wParam = wParam;
-               m.lParam = lParam & 0xdfff;
-               TranslateMessage(&m);
+           if (wParam == VK_PROCESSKEY) { /* IME PROCESS key */
+               if (message == WM_KEYDOWN) {
+                   MSG m;
+                   m.hwnd = hwnd;
+                   m.message = WM_KEYDOWN;
+                   m.wParam = wParam;
+                   m.lParam = lParam & 0xdfff;
+                   TranslateMessage(&m);
+               } else break; /* pass to Windows for default processing */
            } else {
                len = TranslateKey(message, wParam, lParam, buf);
                if (len == -1)