]> git.proxmox.com Git - mirror_novnc.git/commitdiff
Allow key events without symbols
authorPierre Ossman <ossman@cendio.se>
Fri, 2 Jun 2017 12:37:36 +0000 (14:37 +0200)
committerPierre Ossman <ossman@cendio.se>
Fri, 2 Jun 2017 12:37:36 +0000 (14:37 +0200)
They can still be useful if the server makes use of the keycode instead.

core/rfb.js

index de520628cfc4ab995576dbf6f3b3d9c3893977ac..76f75f95de8f1ce0066136a8b3ada5271199670d 100644 (file)
@@ -345,10 +345,16 @@ RFB.prototype = {
                 scancode = 0;
             }
 
+            // 0 is NoSymbol
+            keysym = keysym || 0;
+
             Log.Info("Sending key (" + (down ? "down" : "up") + "): keysym " + keysym + ", scancode " + scancode);
 
             RFB.messages.QEMUExtendedKeyEvent(this._sock, keysym, down, scancode);
         } else {
+            if (!keysym) {
+                return false;
+            }
             Log.Info("Sending keysym (" + (down ? "down" : "up") + "): " + keysym);
             RFB.messages.keyEvent(this._sock, keysym, down ? 1 : 0);
         }