|
@@ -21,14 +21,12 @@ class KeyboardHandler {
|
|
|
let keys = combination.split(" ");
|
|
let keys = combination.split(" ");
|
|
|
|
|
|
|
|
if (keys.every((value, index) => value === this.queue[index])) {
|
|
if (keys.every((value, index) => value === this.queue[index])) {
|
|
|
- this.queue = [];
|
|
|
|
|
- this.shortcuts[combination](event);
|
|
|
|
|
|
|
+ this.execute(combination, event);
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (keys.length === 1 && key === keys[0]) {
|
|
if (keys.length === 1 && key === keys[0]) {
|
|
|
- this.queue = [];
|
|
|
|
|
- this.shortcuts[combination](event);
|
|
|
|
|
|
|
+ this.execute(combination, event);
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -39,6 +37,14 @@ class KeyboardHandler {
|
|
|
};
|
|
};
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ execute(combination, event) {
|
|
|
|
|
+ event.preventDefault();
|
|
|
|
|
+ event.stopPropagation();
|
|
|
|
|
+
|
|
|
|
|
+ this.queue = [];
|
|
|
|
|
+ this.shortcuts[combination](event);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
isEventIgnored(event) {
|
|
isEventIgnored(event) {
|
|
|
return event.target.tagName === "INPUT" || event.target.tagName === "TEXTAREA";
|
|
return event.target.tagName === "INPUT" || event.target.tagName === "TEXTAREA";
|
|
|
}
|
|
}
|