From befbd670945df2788dea64d5d2000349a4674e56 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Fri, 20 Nov 2020 10:51:25 +0100 Subject: [PATCH] Fake key release events for some Japanese keys Windows either completely omits WM_KEYUP for these, or only sends it just before the next WM_KEYDOWN for the key. --- vncviewer/Viewport.cxx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/vncviewer/Viewport.cxx b/vncviewer/Viewport.cxx index 84777be1..b5466acb 100644 --- a/vncviewer/Viewport.cxx +++ b/vncviewer/Viewport.cxx @@ -1060,6 +1060,16 @@ int Viewport::handleSystemEvent(void *event, void *data) self->handleKeyPress(keyCode, keySym); + // We don't get reliable WM_KEYUP for these + switch (keySym) { + case XK_Zenkaku_Hankaku: + case XK_Eisu_toggle: + case XK_Katakana: + case XK_Hiragana: + case XK_Romaji: + self->handleKeyRelease(keyCode); + } + return 1; } else if ((msg->message == WM_KEYUP) || (msg->message == WM_SYSKEYUP)) { UINT vKey; -- 2.39.5