Skip to content

Commit

Permalink
Check meta key
Browse files Browse the repository at this point in the history
  • Loading branch information
syuilo committed Sep 24, 2018
1 parent 87091a2 commit e6cc937
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/client/app/common/hotkey.ts
Expand Up @@ -59,7 +59,7 @@ export default {

el.dataset.reservedKeys = reservedKeys.map(key => `'${key}'`).join(' ');

el._keyHandler = e => {
el._keyHandler = (e: KeyboardEvent) => {
const key = e.code.toLowerCase();

const targetReservedKeys = document.activeElement ? ((document.activeElement as any).dataset || {}).reservedKeys || '' : '';
Expand All @@ -72,7 +72,8 @@ export default {
const matched = pattern.which.includes(key) &&
pattern.ctrl == e.ctrlKey &&
pattern.shift == e.shiftKey &&
pattern.alt == e.altKey;
pattern.alt == e.altKey &&
e.metaKey == false;

if (matched) {
e.preventDefault();
Expand Down

0 comments on commit e6cc937

Please sign in to comment.