aboutsummaryrefslogtreecommitdiff
path: root/xP
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2022-10-04 20:14:52 +0200
committerPřemysl Eric Janouch <p@janouch.name>2022-10-04 20:17:31 +0200
commit4b7258cba0dc71cfc7d3adef1b5dd7f9e610c28b (patch)
tree42282b2abf938ed46463562eb66d61406a400110 /xP
parent9dc3dd02f397f83941fbcc7d5271a33857cb5df3 (diff)
downloadxK-4b7258cba0dc71cfc7d3adef1b5dd7f9e610c28b.tar.gz
xK-4b7258cba0dc71cfc7d3adef1b5dd7f9e610c28b.tar.xz
xK-4b7258cba0dc71cfc7d3adef1b5dd7f9e610c28b.zip
xP: fix ESC H detection on Macintosh systems
Diffstat (limited to 'xP')
-rw-r--r--xP/public/xP.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/xP/public/xP.js b/xP/public/xP.js
index 795641d..8a117f0 100644
--- a/xP/public/xP.js
+++ b/xP/public/xP.js
@@ -1058,6 +1058,13 @@ let lastWasEscape = false
document.addEventListener('keydown', event => {
event.escapePrefix = lastWasEscape
if (lastWasEscape) {
+ // https://www.w3.org/TR/uievents-key/#keys-modifier
+ // https://bugzilla.mozilla.org/show_bug.cgi?id=1232918
+ if (["Alt", "AltGraph", "CapsLock", "Control", "Fn", "FnLock",
+ "Meta", "NumLock", "ScrollLock", "Shift", "Symbol", "SymbolLock",
+ "Hyper", "Super", "OS"].indexOf(event.key) != -1)
+ return
+
lastWasEscape = false
} else if (event.code == 'Escape' &&
navigator.userAgentData?.platform === 'macOS') {