Skip to content

Commit

Permalink
fix #1365
Browse files Browse the repository at this point in the history
  • Loading branch information
jhchen committed Mar 23, 2017
1 parent d7f7644 commit d9995da
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion modules/keyboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ const SHORTKEY = /Mac/i.test(navigator.platform) ? 'metaKey' : 'ctrlKey';
class Keyboard extends Module {
static match(evt, binding) {
binding = normalize(binding);
if (!!binding.shortKey !== evt[SHORTKEY] && binding.shortKey !== null) return false;
if (binding.shortKey != null && !!binding.shortKey !== evt[SHORTKEY] && !!binding[SHORTKEY] !== evt[SHORTKEY]) {
return false;
}
if (['altKey', 'ctrlKey', 'metaKey', 'shiftKey'].some(function(key) {
return (key != SHORTKEY && !!binding[key] !== evt[key] && binding[key] !== null);
})) {
Expand Down

0 comments on commit d9995da

Please sign in to comment.