summaryrefslogtreecommitdiff
path: root/core/input
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2017-06-21 14:02:24 +0200
committerPierre Ossman <ossman@cendio.se>2017-06-21 14:02:24 +0200
commite7c4d669f0f0267356c37b20b35ff50bbd204cb2 (patch)
tree9cffed903442f1d519aeafd9a3df2f3d2f2d1f38 /core/input
parent9e99ce126ca8f6f350fa015c0e58d35103c62f7e (diff)
downloadnovnc-e7c4d669f0f0267356c37b20b35ff50bbd204cb2.tar.gz
Handle iOS special keys
Diffstat (limited to 'core/input')
-rw-r--r--core/input/util.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/core/input/util.js b/core/input/util.js
index 4335b0b..78a829c 100644
--- a/core/input/util.js
+++ b/core/input/util.js
@@ -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())) {