fix: disallow null inputs when editing

feat: allow special inputs while creating a chord input
fixes #93
This commit is contained in:
2024-01-30 19:49:10 +01:00
parent 44d89d3f35
commit 6ab6959129
6 changed files with 17 additions and 17 deletions

View File

@@ -28,7 +28,12 @@
function keydown(event: KeyboardEvent) {
if (!editing) return
event.preventDefault()
pressedKeys.add(inputToAction(event, get(serialPort)?.device === "X")!)
const input = inputToAction(event, get(serialPort)?.device === "X")
if (input == undefined) {
alert("Invalid key")
return
}
pressedKeys.add(input)
pressedKeys = pressedKeys
}