]> git.proxmox.com Git - mirror_novnc.git/commitdiff
Make the touch-keyboard code more robust through verifying that global variables...
authorsamhed <samuel@cendio.se>
Thu, 5 Mar 2015 08:54:56 +0000 (09:54 +0100)
committersamhed <samuel@cendio.se>
Thu, 5 Mar 2015 08:54:56 +0000 (09:54 +0100)
include/ui.js

index a5433dce8c7f74984ff0f9eef39722fef935315f..fb28e3ea2b8e7dc479347b6feeca1d80d211bfa5 100644 (file)
@@ -925,8 +925,15 @@ var UI;
         // This code is required since some browsers on Android are inconsistent in
         // sending keyCodes in the normal keyboard events when using on screen keyboards.
         keyInput: function(event) {
+
+            if (!UI.rfb) { return; }
+
             var newValue = event.target.value;
-            var oldValue = UI.lastKeyboardinput;
+
+            if (!UI.lastKeyboardinput) {
+                UI.keyboardinputReset();
+            }
+            var oldvalue = UI.lastKeyboardinput;
 
             var newLen;
             try {