parent
33523d8dfa
commit
bdac34273e
|
@ -131,13 +131,7 @@ const matchPatterns = (ev: KeyboardEvent, action: Action) => {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
let lastHotKeyStoreTimer: number | null = null;
|
|
||||||
|
|
||||||
const storePattern = (ev: KeyboardEvent, callback: CallbackFunction) => {
|
const storePattern = (ev: KeyboardEvent, callback: CallbackFunction) => {
|
||||||
if (lastHotKeyStoreTimer != null) {
|
|
||||||
clearTimeout(lastHotKeyStoreTimer);
|
|
||||||
}
|
|
||||||
|
|
||||||
latestHotkey = {
|
latestHotkey = {
|
||||||
which: [ev.key.toLowerCase()],
|
which: [ev.key.toLowerCase()],
|
||||||
ctrl: ev.ctrlKey || ev.metaKey,
|
ctrl: ev.ctrlKey || ev.metaKey,
|
||||||
|
@ -145,10 +139,6 @@ const storePattern = (ev: KeyboardEvent, callback: CallbackFunction) => {
|
||||||
shift: ev.shiftKey,
|
shift: ev.shiftKey,
|
||||||
callback,
|
callback,
|
||||||
};
|
};
|
||||||
|
|
||||||
lastHotKeyStoreTimer = window.setTimeout(() => {
|
|
||||||
latestHotkey = null;
|
|
||||||
}, 500);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const parseKeyCode = (input?: string | null) => {
|
const parseKeyCode = (input?: string | null) => {
|
||||||
|
|
Loading…
Reference in a new issue