Skip to content

Commit

Permalink
Fix #24 isPressed method issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed May 10, 2018
1 parent 44dd590 commit d37d855
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ function isPressed(keyCode) {
if (typeof (keyCode) === 'string') {
keyCode = code(keyCode); // 转换成键码
}

return _downKeys.indexOf(keyCode) !== -1;
}

Expand Down Expand Up @@ -56,8 +55,8 @@ function deleteScope(scope, newScope) {

// 清除修饰键
function clearModifier(event) {
const i = _downKeys.indexOf(key);
let key = event.keyCode || event.which || event.charCode;
const i = _downKeys.indexOf(key);

// 从列表中清除按压过的键
if (i >= 0) _downKeys.splice(i, 1);
Expand Down

0 comments on commit d37d855

Please sign in to comment.