mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2025-08-04 13:30:48 +00:00
Prevent modifier key repeat from bogging down the app on WIndows
Closes #767
This commit is contained in:
parent
ccdfdd3015
commit
5bf7b9fdf8
1 changed files with 3 additions and 0 deletions
|
@ -99,6 +99,9 @@ export function createInputManager(editor: Editor, container: HTMLElement, dialo
|
|||
async function onKeyDown(e: KeyboardEvent): Promise<void> {
|
||||
const key = await getLocalizedScanCode(e);
|
||||
|
||||
const NO_KEY_REPEAT_MODIFIER_KEYS = ["ControlLeft", "ControlRight", "ShiftLeft", "ShiftRight", "MetaLeft", "MetaRight", "AltLeft", "AltRight", "AltGraph", "CapsLock", "Fn", "FnLock"];
|
||||
if (e.repeat && NO_KEY_REPEAT_MODIFIER_KEYS.includes(key)) return;
|
||||
|
||||
if (await shouldRedirectKeyboardEventToBackend(e)) {
|
||||
e.preventDefault();
|
||||
const modifiers = makeKeyboardModifiersBitfield(e);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue