From 054d0bb4a50ece2cc331cc71a9422e8f7adee1c2 Mon Sep 17 00:00:00 2001 From: jaywcjlove <398188662@qq.com> Date: Tue, 24 Mar 2020 23:50:56 +0800 Subject: [PATCH] fix: More browser support. #129 --- src/main.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main.js b/src/main.js index 9130f77..100fccb 100644 --- a/src/main.js +++ b/src/main.js @@ -245,8 +245,12 @@ function dispatch(event) { _mods[e] = event[modifierMap[e]]; } } - - if (event.getModifierState('AltGraph')) { + /** + * https://github.com/jaywcjlove/hotkeys/pull/129 + * This solves the issue in Firefox on Windows where hotkeys corresponding to special characters would not trigger. + * An example of this is ctrl+alt+m on a Swedish keyboard which is used to type μ. + */ + if (event.getModifierState && event.getModifierState('AltGraph')) { _downKeys.push(17, 18); _mods[17] = true; _mods[18] = true;