]> git.proxmox.com Git - mirror_novnc.git/blobdiff - core/input/util.js
Handle iOS special keys
[mirror_novnc.git] / core / input / util.js
index 4335b0bfe48d59eb4daf9e4eca23157a3141480d..78a829c8bf4c6a2a43fc75c5da793cf792cb733c 100644 (file)
@@ -103,6 +103,15 @@ export function getKey(evt) {
             case 'OS': return 'Meta';
         }
 
+        // iOS leaks some OS names
+        switch (evt.key) {
+            case 'UIKeyInputUpArrow': return 'ArrowUp';
+            case 'UIKeyInputDownArrow': return 'ArrowDown';
+            case 'UIKeyInputLeftArrow': return 'ArrowLeft';
+            case 'UIKeyInputRightArrow': return 'ArrowRight';
+            case 'UIKeyInputEscape': return 'Escape';
+        }
+
         // IE and Edge have broken handling of AltGraph so we cannot
         // trust them for printable characters
         if ((evt.key.length !== 1) || (!isIE() && !isEdge())) {