Skip to content

Commit

Permalink
released v3.6.6 #72
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed May 7, 2019
1 parent 3bbefc8 commit 9d6e2b9
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 15 deletions.
9 changes: 6 additions & 3 deletions dist/hotkeys.common.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* hotkeys-js v3.6.5
* hotkeys-js v3.6.6
* A simple micro-library for defining and dispatching keyboard shortcuts. It has no dependencies.
*
* Copyright (c) 2019 kenny wong <[email protected]>
Expand Down Expand Up @@ -293,9 +293,12 @@ function eventHandler(event, handler, scope) {

function dispatch(event) {
var asterisk = _handlers['*'];
var key = event.keyCode || event.which || event.charCode; // 搜集绑定的键
var key = event.keyCode || event.which || event.charCode; // 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

if (_downKeys.indexOf(key) === -1) _downKeys.push(key); // Gecko(Firefox)的command键值224,在Webkit(Chrome)中保持一致
if (_downKeys.indexOf(key) === -1 && key !== 229) _downKeys.push(key); // Gecko(Firefox)的command键值224,在Webkit(Chrome)中保持一致
// Webkit左右command键值不一样

if (key === 93 || key === 224) key = 91;
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.

9 changes: 6 additions & 3 deletions dist/hotkeys.esm.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* hotkeys-js v3.6.5
* hotkeys-js v3.6.6
* A simple micro-library for defining and dispatching keyboard shortcuts. It has no dependencies.
*
* Copyright (c) 2019 kenny wong <[email protected]>
Expand Down Expand Up @@ -291,9 +291,12 @@ function eventHandler(event, handler, scope) {

function dispatch(event) {
var asterisk = _handlers['*'];
var key = event.keyCode || event.which || event.charCode; // 搜集绑定的键
var key = event.keyCode || event.which || event.charCode; // 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

if (_downKeys.indexOf(key) === -1) _downKeys.push(key); // Gecko(Firefox)的command键值224,在Webkit(Chrome)中保持一致
if (_downKeys.indexOf(key) === -1 && key !== 229) _downKeys.push(key); // Gecko(Firefox)的command键值224,在Webkit(Chrome)中保持一致
// Webkit左右command键值不一样

if (key === 93 || key === 224) key = 91;
Expand Down
9 changes: 6 additions & 3 deletions dist/hotkeys.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* hotkeys-js v3.6.5
* hotkeys-js v3.6.6
* A simple micro-library for defining and dispatching keyboard shortcuts. It has no dependencies.
*
* Copyright (c) 2019 kenny wong <[email protected]>
Expand Down Expand Up @@ -297,9 +297,12 @@

function dispatch(event) {
var asterisk = _handlers['*'];
var key = event.keyCode || event.which || event.charCode; // 搜集绑定的键
var key = event.keyCode || event.which || event.charCode; // 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

if (_downKeys.indexOf(key) === -1) _downKeys.push(key); // Gecko(Firefox)的command键值224,在Webkit(Chrome)中保持一致
if (_downKeys.indexOf(key) === -1 && key !== 229) _downKeys.push(key); // Gecko(Firefox)的command键值224,在Webkit(Chrome)中保持一致
// Webkit左右command键值不一样

if (key === 93 || key === 224) key = 91;
Expand Down
Loading

0 comments on commit 9d6e2b9

Please sign in to comment.