live hotkey capture

This commit is contained in:
2026-05-12 00:08:24 +03:00
parent 14d02cdad4
commit 7a821f54fc
3 changed files with 144 additions and 45 deletions
+6 -20
View File
@@ -1,6 +1,7 @@
<script lang="ts">
import { onMount } from "svelte"
import { api, type Config } from "./api"
import HotkeyInput from "./HotkeyInput.svelte"
let { onClose }: { onClose: () => void } = $props()
@@ -89,30 +90,15 @@
<h2>hotkeys</h2>
<label>
<span>start</span>
<input
type="text"
placeholder="F9"
value={cfg.hotkeys.start ?? ""}
oninput={(e) => cfg && (cfg.hotkeys.start = (e.currentTarget as HTMLInputElement).value || null)}
/>
<HotkeyInput bind:value={cfg.hotkeys.start} placeholder="click to assign" />
</label>
<label>
<span>stop</span>
<input
type="text"
placeholder="F9"
value={cfg.hotkeys.stop ?? ""}
oninput={(e) => cfg && (cfg.hotkeys.stop = (e.currentTarget as HTMLInputElement).value || null)}
/>
<HotkeyInput bind:value={cfg.hotkeys.stop} placeholder="click to assign" />
</label>
<label>
<span>pause</span>
<input
type="text"
placeholder="F10"
value={cfg.hotkeys.pause ?? ""}
oninput={(e) => cfg && (cfg.hotkeys.pause = (e.currentTarget as HTMLInputElement).value || null)}
/>
<HotkeyInput bind:value={cfg.hotkeys.pause} placeholder="click to assign" />
</label>
</section>
@@ -177,7 +163,7 @@
label.check {
grid-template-columns: 20px 1fr;
}
select, input[type="text"] {
select {
font: inherit;
padding: 0.4rem 0.6rem;
border: 1px solid #444;
@@ -185,7 +171,7 @@
color: inherit;
border-radius: 4px;
}
input[type="text"]:focus, select:focus {
select:focus {
outline: none;
border-color: #4a8;
}