This commit is contained in:
the-djmaze 2022-02-28 11:35:29 +01:00
parent 92079fd6f7
commit ed959459ef
12 changed files with 33 additions and 96 deletions

View file

@ -64,7 +64,7 @@ const
keydown = event => {
let key = (event.key || '').toLowerCase().replace(' ','space'),
target = event.target;
// ignore keydown in any element that supports keyboard input unless it's the Escape key
// ignore keydown in any element that supports keyboard input unless it's the Escape key
if ('escape' === key || !target.closest || !target.closest('input,select,textarea,[contenteditable]')) {
let modifiers = ['alt','ctrl','meta','shift'].filter(v => event[v+'Key']).join('+');
scope[key] && scope[key][modifiers] && scope[key][modifiers].forEach(cmd => exec(event, cmd));