]> source.dussan.org Git - tigervnc.git/commitdiff
Fake key release events for some Japanese keys 1142/head
authorPierre Ossman <ossman@cendio.se>
Fri, 20 Nov 2020 09:51:25 +0000 (10:51 +0100)
committerPierre Ossman <ossman@cendio.se>
Fri, 20 Nov 2020 09:51:25 +0000 (10:51 +0100)
Windows either completely omits WM_KEYUP for these, or only sends it
just before the next WM_KEYDOWN for the key.

vncviewer/Viewport.cxx

index 84777be17e71447e24fe926a8ecf9cec256cfdd8..b5466acb9158a78b39b362096a6477b09ba24bd6 100644 (file)
@@ -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;