From 51d6f0ce0ce7fa8e348193c2c1bb40b170a502d5 Mon Sep 17 00:00:00 2001 From: jaywcjlove <398188662@qq.com> Date: Tue, 24 Mar 2020 23:56:27 +0800 Subject: [PATCH] released v3.7.4 #129 --- dist/hotkeys.common.js | 16 +++++++++++++++- dist/hotkeys.common.min.js | 4 ++-- dist/hotkeys.esm.js | 16 +++++++++++++++- dist/hotkeys.js | 16 +++++++++++++++- dist/hotkeys.min.js | 4 ++-- package-lock.json | 2 +- package.json | 2 +- 7 files changed, 51 insertions(+), 9 deletions(-) diff --git a/dist/hotkeys.common.js b/dist/hotkeys.common.js index 6516a46..781bd78 100644 --- a/dist/hotkeys.common.js +++ b/dist/hotkeys.common.js @@ -1,5 +1,5 @@ /*! - * hotkeys-js v3.7.3 + * hotkeys-js v3.7.4 * A simple micro-library for defining and dispatching keyboard shortcuts. It has no dependencies. * * Copyright (c) 2020 kenny wong @@ -396,6 +396,20 @@ function dispatch(event) { if (Object.prototype.hasOwnProperty.call(_mods, e)) { _mods[e] = event[modifierMap[e]]; } + } + /** + * 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 μ. + * Browser support: https://caniuse.com/#feat=keyboardevent-getmodifierstate + */ + + + if (event.getModifierState && event.getModifierState('AltGraph')) { + _downKeys.push(17, 18); + + _mods[17] = true; + _mods[18] = true; } // 获取范围 默认为 `all` diff --git a/dist/hotkeys.common.min.js b/dist/hotkeys.common.min.js index a5881d7..f3d8ac3 100644 --- a/dist/hotkeys.common.min.js +++ b/dist/hotkeys.common.min.js @@ -1,2 +1,2 @@ -/*! hotkeys-js v3.7.3 | MIT (c) 2020 kenny wong | http://jaywcjlove.github.io/hotkeys */ -"use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var isff="undefined"!=typeof navigator&&0 | http://jaywcjlove.github.io/hotkeys */ +"use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var isff="undefined"!=typeof navigator&&0 @@ -394,6 +394,20 @@ function dispatch(event) { if (Object.prototype.hasOwnProperty.call(_mods, e)) { _mods[e] = event[modifierMap[e]]; } + } + /** + * 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 μ. + * Browser support: https://caniuse.com/#feat=keyboardevent-getmodifierstate + */ + + + if (event.getModifierState && event.getModifierState('AltGraph')) { + _downKeys.push(17, 18); + + _mods[17] = true; + _mods[18] = true; } // 获取范围 默认为 `all` diff --git a/dist/hotkeys.js b/dist/hotkeys.js index 38e8c48..aa6e29c 100644 --- a/dist/hotkeys.js +++ b/dist/hotkeys.js @@ -1,5 +1,5 @@ /*! - * hotkeys-js v3.7.3 + * hotkeys-js v3.7.4 * A simple micro-library for defining and dispatching keyboard shortcuts. It has no dependencies. * * Copyright (c) 2020 kenny wong @@ -400,6 +400,20 @@ if (Object.prototype.hasOwnProperty.call(_mods, e)) { _mods[e] = event[modifierMap[e]]; } + } + /** + * 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 μ. + * Browser support: https://caniuse.com/#feat=keyboardevent-getmodifierstate + */ + + + if (event.getModifierState && event.getModifierState('AltGraph')) { + _downKeys.push(17, 18); + + _mods[17] = true; + _mods[18] = true; } // 获取范围 默认为 `all` diff --git a/dist/hotkeys.min.js b/dist/hotkeys.min.js index 2c1309e..b79f8bc 100644 --- a/dist/hotkeys.min.js +++ b/dist/hotkeys.min.js @@ -1,2 +1,2 @@ -/*! hotkeys-js v3.7.3 | MIT (c) 2020 kenny wong | http://jaywcjlove.github.io/hotkeys */ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).hotkeys=t()}(this,function(){"use strict";function f(e){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var e="undefined"!=typeof navigator&&0 | http://jaywcjlove.github.io/hotkeys */ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).hotkeys=t()}(this,function(){"use strict";function f(e){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var e="undefined"!=typeof navigator&&0