]> source.dussan.org Git - tigervnc.git/commitdiff
[Bugfix] Handle situation when viewer doesn't send the key release event well.
authorAdam Tkac <atkac@redhat.com>
Mon, 17 Jan 2011 10:58:08 +0000 (10:58 +0000)
committerAdam Tkac <atkac@redhat.com>
Mon, 17 Jan 2011 10:58:08 +0000 (10:58 +0000)
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

index ca9bae3efba7843b65ed896bb3736ab9e9c2dbc5..f36244a4fe1baec1a2c05325499aa74d8870e402 100644 (file)
@@ -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) {