From 6959da13906a761b7ac5b186761315000b3f21cb Mon Sep 17 00:00:00 2001 From: Adam Tkac Date: Mon, 17 Jan 2011 10:58:08 +0000 Subject: [PATCH] [Bugfix] Handle situation when viewer doesn't send the key release event well. Happens for example with TightVNC 1.3.10 viewer during following sequence: "press shift" + "press a" + "release shift" + "release a" git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4237 3789f03b-4d11-0410-bbf8-ca57d06f2519 --- unix/xserver/hw/vnc/Input.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/unix/xserver/hw/vnc/Input.cc b/unix/xserver/hw/vnc/Input.cc index ca9bae3e..f36244a4 100644 --- a/unix/xserver/hw/vnc/Input.cc +++ b/unix/xserver/hw/vnc/Input.cc @@ -781,6 +781,16 @@ ModeSwitchFound: } } } +#else + /* + * If you would like to press a key which is already pressed then + * viewer didn't send the "release" event. In this case release it + * before the press. + */ + if (IS_PRESSED(keyc, kc) && down) { + vlog.debug("KeyRelease for %d wasn't sent, releasing", kc); + pressKey(keyboardDev, kc, false, "fixing keycode"); + } #endif if (maxKeysPerMod != 0) { -- 2.39.5