fix: can't cancel the chord input recording

fixes #109
This commit is contained in:
2024-04-23 16:52:36 +02:00
parent c9a031a1fd
commit 77d4a90519

View File

@@ -26,6 +26,8 @@
} }
function keydown(event: KeyboardEvent) { function keydown(event: KeyboardEvent) {
// This is obviously a tradeoff
if (event.key === "Tab" || event.key === "Escape") return;
if (!editing) return; if (!editing) return;
event.preventDefault(); event.preventDefault();
const input = inputToAction(event, get(serialPort)?.device === "X"); const input = inputToAction(event, get(serialPort)?.device === "X");
@@ -85,6 +87,7 @@
on:click={edit} on:click={edit}
on:keydown={keydown} on:keydown={keydown}
on:keyup={keyup} on:keyup={keyup}
on:blur={keyup}
> >
{#if editing && pressedKeys.size === 0} {#if editing && pressedKeys.size === 0}
<span>{$LL.configure.chords.HOLD_KEYS()}</span> <span>{$LL.configure.chords.HOLD_KEYS()}</span>