Skip to content

Commit

Permalink
chore: do filter in advance (#76)
Browse files Browse the repository at this point in the history
  • Loading branch information
yyjjqq94 authored and jaywcjlove committed May 16, 2019
1 parent 2c9814e commit e3c00e2
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 17 deletions.
8 changes: 4 additions & 4 deletions dist/hotkeys.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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(); // 对任何快捷键都需要做的处理

Expand Down
2 changes: 1 addition & 1 deletion dist/hotkeys.common.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions dist/hotkeys.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,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
Expand All @@ -322,10 +324,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(); // 对任何快捷键都需要做的处理

Expand Down
8 changes: 4 additions & 4 deletions dist/hotkeys.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,9 @@

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
Expand All @@ -328,10 +330,8 @@
if (Object.prototype.hasOwnProperty.call(_mods, e)) {
_mods[e] = event[modifierMap[e]];
}
} // 表单控件过滤 默认表单控件不触发快捷键

} // 获取范围 默认为all

if (!hotkeys.filter.call(this, event)) return; // 获取范围 默认为all

var scope = getScope(); // 对任何快捷键都需要做的处理

Expand Down
Loading

0 comments on commit e3c00e2

Please sign in to comment.