summaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
authorMaxim Devaev <[email protected]>2023-07-21 19:29:55 +0300
committerMaxim Devaev <[email protected]>2023-07-21 19:29:55 +0300
commite44f37377155be0d8140f5b5715b9b58d011c3e8 (patch)
treec0b4f272eb645aaf4c2eab3299b1d0ceeca8deb8 /web
parent3dd05af8f5acc6f6fe5706ba0bb20460c44df3ac (diff)
web: improved mac cmd key handling
Diffstat (limited to 'web')
-rw-r--r--web/share/js/keypad.js20
1 files changed, 8 insertions, 12 deletions
diff --git a/web/share/js/keypad.js b/web/share/js/keypad.js
index 5a50b715..9c74dcd8 100644
--- a/web/share/js/keypad.js
+++ b/web/share/js/keypad.js
@@ -119,24 +119,20 @@ export function Keypad(__keys_parent, __sendKey, __apply_fixes) {
return;
}
}
- __commonHandler(__merged[code][0], state, false);
if (__fix_mac_cmd && apply_fixes) {
- __fixMacCmd();
+ __fixMacCmd(code, state);
}
+ __commonHandler(__merged[code][0], state, false);
__unholdModifiers();
}
};
- var __fixMacCmd = function() {
- // https://bugs.chromium.org/p/chromium/issues/detail?id=28089
- // https://bugzilla.mozilla.org/show_bug.cgi?id=1299553
- if (__isActive(__modifiers["MetaLeft"][0]) || __isActive(__modifiers["MetaRight"][0])) {
- for (let code in __keys) {
- setTimeout(function() {
- if (__isActive(__keys[code][0])) {
- self.emitByCode(code, false, false);
- }
- }, 100);
+ var __fixMacCmd = function(code, state) {
+ if ((code == "MetaLeft" || code == "MetaRight") && !state) {
+ for (code in __keys) {
+ if (__isActive(__keys[code][0])) {
+ self.emitByCode(code, false, false);
+ }
}
}
};