We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b104485 commit 40a7509Copy full SHA for 40a7509
packages/frontend/src/scripts/hotkey.ts
@@ -131,14 +131,24 @@ const matchPatterns = (ev: KeyboardEvent, action: Action) => {
131
});
132
};
133
134
+let lastHotKeyStoreTimer: number | null = null;
135
+
136
const storePattern = (ev: KeyboardEvent, callback: CallbackFunction) => {
137
+ if (lastHotKeyStoreTimer != null) {
138
+ clearTimeout(lastHotKeyStoreTimer);
139
+ }
140
141
latestHotkey = {
142
which: [ev.key.toLowerCase()],
143
ctrl: ev.ctrlKey || ev.metaKey,
144
alt: ev.altKey,
145
shift: ev.shiftKey,
146
callback,
147
148
149
+ lastHotKeyStoreTimer = window.setTimeout(() => {
150
+ latestHotkey = null;
151
+ }, 500);
152
153
154
const parseKeyCode = (input?: string | null) => {
0 commit comments