mirror of
https://github.com/hotomoe/hotomoe
synced 2024-12-05 18:28:12 +09:00
Check meta key
This commit is contained in:
parent
87091a2e03
commit
e6cc937ac2
@ -59,7 +59,7 @@ export default {
|
|||||||
|
|
||||||
el.dataset.reservedKeys = reservedKeys.map(key => `'${key}'`).join(' ');
|
el.dataset.reservedKeys = reservedKeys.map(key => `'${key}'`).join(' ');
|
||||||
|
|
||||||
el._keyHandler = e => {
|
el._keyHandler = (e: KeyboardEvent) => {
|
||||||
const key = e.code.toLowerCase();
|
const key = e.code.toLowerCase();
|
||||||
|
|
||||||
const targetReservedKeys = document.activeElement ? ((document.activeElement as any).dataset || {}).reservedKeys || '' : '';
|
const targetReservedKeys = document.activeElement ? ((document.activeElement as any).dataset || {}).reservedKeys || '' : '';
|
||||||
@ -72,7 +72,8 @@ export default {
|
|||||||
const matched = pattern.which.includes(key) &&
|
const matched = pattern.which.includes(key) &&
|
||||||
pattern.ctrl == e.ctrlKey &&
|
pattern.ctrl == e.ctrlKey &&
|
||||||
pattern.shift == e.shiftKey &&
|
pattern.shift == e.shiftKey &&
|
||||||
pattern.alt == e.altKey;
|
pattern.alt == e.altKey &&
|
||||||
|
e.metaKey == false;
|
||||||
|
|
||||||
if (matched) {
|
if (matched) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
Loading…
Reference in New Issue
Block a user