diff --git a/dist/hotkeys.common.js b/dist/hotkeys.common.js index fac7dee..43945dc 100644 --- a/dist/hotkeys.common.js +++ b/dist/hotkeys.common.js @@ -299,7 +299,9 @@ function eventHandler(event, handler, scope) { function dispatch(event) { var asterisk = _handlers['*']; - var key = event.keyCode || event.which || event.charCode; // Collect bound keys + var key = event.keyCode || event.which || event.charCode; // 表单控件过滤 默认表单控件不触发快捷键 + + if (!hotkeys.filter.call(this, event)) return; // Collect bound keys // If an Input Method Editor is processing key input and the event is keydown, return 229. // https://stackoverflow.com/questions/25043934/is-it-ok-to-ignore-keydown-events-with-keycode-229 // http://lists.w3.org/Archives/Public/www-dom/2010JulSep/att-0182/keyCode-spec.html @@ -324,10 +326,8 @@ function dispatch(event) { if (Object.prototype.hasOwnProperty.call(_mods, e)) { _mods[e] = event[modifierMap[e]]; } - } // 表单控件过滤 默认表单控件不触发快捷键 - + } // 获取范围 默认为all - if (!hotkeys.filter.call(this, event)) return; // 获取范围 默认为all var scope = getScope(); // 对任何快捷键都需要做的处理 diff --git a/dist/hotkeys.common.min.js b/dist/hotkeys.common.min.js index 24465b9..d1f6ec9 100644 --- a/dist/hotkeys.common.min.js +++ b/dist/hotkeys.common.min.js @@ -1,2 +1,2 @@ /*! hotkeys-js v3.6.8 | MIT (c) 2019 kenny wong | http://jaywcjlove.github.io/hotkeys */ -"use strict";var isff="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";var e="undefined"!=typeof navigator&&0