]> git.proxmox.com Git - mirror_novnc.git/blobdiff - app/ui.js
Merge branch 'keyboard' of https://github.com/CendioOssman/noVNC
[mirror_novnc.git] / app / ui.js
index 91f056a32970f0ad3dadbd26a4bcfeeb44432cec..cdf1cc5bd10bf7d2edc7621a69c4316ef6d8ae7a 100644 (file)
--- a/app/ui.js
+++ b/app/ui.js
@@ -1516,10 +1516,10 @@ const UI = {
 
         // Send the key events
         for (i = 0; i < backspaces; i++) {
-            UI.rfb.sendKey(KeyTable.XK_BackSpace);
+            UI.rfb.sendKey(KeyTable.XK_BackSpace, "Backspace");
         }
         for (i = newLen - inputs; i < newLen; i++) {
-            UI.rfb.sendKey(keysyms.fromUnicode(newValue.charCodeAt(i)).keysym);
+            UI.rfb.sendKey(keysyms.lookup(newValue.charCodeAt(i)));
         }
 
         // Control the text content length in the keyboardinput element
@@ -1573,7 +1573,7 @@ const UI = {
     },
 
     sendEsc: function() {
-        UI.rfb.sendKey(KeyTable.XK_Escape);
+        UI.rfb.sendKey(KeyTable.XK_Escape, "Escape");
     },
 
     sendTab: function() {
@@ -1583,10 +1583,10 @@ const UI = {
     toggleCtrl: function() {
         var btn = document.getElementById('noVNC_toggle_ctrl_button');
         if (btn.classList.contains("noVNC_selected")) {
-            UI.rfb.sendKey(KeyTable.XK_Control_L, false);
+            UI.rfb.sendKey(KeyTable.XK_Control_L, "ControlLeft", false);
             btn.classList.remove("noVNC_selected");
         } else {
-            UI.rfb.sendKey(KeyTable.XK_Control_L, true);
+            UI.rfb.sendKey(KeyTable.XK_Control_L, "ControlLeft", true);
             btn.classList.add("noVNC_selected");
         }
     },
@@ -1594,10 +1594,10 @@ const UI = {
     toggleAlt: function() {
         var btn = document.getElementById('noVNC_toggle_alt_button');
         if (btn.classList.contains("noVNC_selected")) {
-            UI.rfb.sendKey(KeyTable.XK_Alt_L, false);
+            UI.rfb.sendKey(KeyTable.XK_Alt_L, "AltLeft", false);
             btn.classList.remove("noVNC_selected");
         } else {
-            UI.rfb.sendKey(KeyTable.XK_Alt_L, true);
+            UI.rfb.sendKey(KeyTable.XK_Alt_L, "AltLeft", true);
             btn.classList.add("noVNC_selected");
         }
     },