Skip to content

Commit

Permalink
released v3.8.8
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Apr 8, 2022
1 parent b6ad954 commit bced404
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 37 deletions.
26 changes: 16 additions & 10 deletions dist/hotkeys.common.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
/*!
* hotkeys-js v3.8.7
* A simple micro-library for defining and dispatching keyboard shortcuts. It has no dependencies.
/**!
* hotkeys-js v3.8.8
* A simple micro-library for defining and dispatching keyboard shortcuts. It has no dependencies.
*
* Copyright (c) 2022 kenny wong <[email protected]>
* http://jaywcjlove.github.io/hotkeys
*
* Licensed under the MIT license.
* Copyright (c) 2022 kenny wong <[email protected]>
* http://jaywcjlove.github.io/hotkeys
* Licensed under the MIT license
*/

'use strict';
Expand Down Expand Up @@ -157,6 +156,8 @@ for (var k = 1; k < 20; k++) {

var _downKeys = []; // 记录摁下的绑定键

var winListendFocus = false; // window是否已经监听了focus事件

var _scope = 'all'; // 默认热键范围

var elementHasBindEvent = []; // 已绑定事件的节点记录
Expand Down Expand Up @@ -526,9 +527,14 @@ function hotkeys(key, option, method) {
addEvent(element, 'keydown', function (e) {
dispatch(e);
});
addEvent(window, 'focus', function () {
_downKeys = [];
});

if (!winListendFocus) {
winListendFocus = true;
addEvent(window, 'focus', function () {
_downKeys = [];
});
}

addEvent(element, 'keyup', function (e) {
dispatch(e);
clearModifier(e);
Expand Down
4 changes: 2 additions & 2 deletions dist/hotkeys.common.min.js

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

26 changes: 16 additions & 10 deletions dist/hotkeys.esm.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
/*!
* hotkeys-js v3.8.7
* A simple micro-library for defining and dispatching keyboard shortcuts. It has no dependencies.
/**!
* hotkeys-js v3.8.8
* A simple micro-library for defining and dispatching keyboard shortcuts. It has no dependencies.
*
* Copyright (c) 2022 kenny wong <[email protected]>
* http://jaywcjlove.github.io/hotkeys
*
* Licensed under the MIT license.
* Copyright (c) 2022 kenny wong <[email protected]>
* http://jaywcjlove.github.io/hotkeys
* Licensed under the MIT license
*/

var isff = typeof navigator !== 'undefined' ? navigator.userAgent.toLowerCase().indexOf('firefox') > 0 : false; // 绑定事件
Expand Down Expand Up @@ -155,6 +154,8 @@ for (var k = 1; k < 20; k++) {

var _downKeys = []; // 记录摁下的绑定键

var winListendFocus = false; // window是否已经监听了focus事件

var _scope = 'all'; // 默认热键范围

var elementHasBindEvent = []; // 已绑定事件的节点记录
Expand Down Expand Up @@ -524,9 +525,14 @@ function hotkeys(key, option, method) {
addEvent(element, 'keydown', function (e) {
dispatch(e);
});
addEvent(window, 'focus', function () {
_downKeys = [];
});

if (!winListendFocus) {
winListendFocus = true;
addEvent(window, 'focus', function () {
_downKeys = [];
});
}

addEvent(element, 'keyup', function (e) {
dispatch(e);
clearModifier(e);
Expand Down
26 changes: 16 additions & 10 deletions dist/hotkeys.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
/*!
* hotkeys-js v3.8.7
* A simple micro-library for defining and dispatching keyboard shortcuts. It has no dependencies.
/**!
* hotkeys-js v3.8.8
* A simple micro-library for defining and dispatching keyboard shortcuts. It has no dependencies.
*
* Copyright (c) 2022 kenny wong <[email protected]>
* http://jaywcjlove.github.io/hotkeys
*
* Licensed under the MIT license.
* Copyright (c) 2022 kenny wong <[email protected]>
* http://jaywcjlove.github.io/hotkeys
* Licensed under the MIT license
*/

(function (global, factory) {
Expand Down Expand Up @@ -161,6 +160,8 @@

var _downKeys = []; // 记录摁下的绑定键

var winListendFocus = false; // window是否已经监听了focus事件

var _scope = 'all'; // 默认热键范围

var elementHasBindEvent = []; // 已绑定事件的节点记录
Expand Down Expand Up @@ -530,9 +531,14 @@
addEvent(element, 'keydown', function (e) {
dispatch(e);
});
addEvent(window, 'focus', function () {
_downKeys = [];
});

if (!winListendFocus) {
winListendFocus = true;
addEvent(window, 'focus', function () {
_downKeys = [];
});
}

addEvent(element, 'keyup', function (e) {
dispatch(e);
clearModifier(e);
Expand Down
Loading

0 comments on commit bced404

Please sign in to comment.