feat: new chord editing

feat: clear all changes with shift undo, fixes #7
This commit is contained in:
2023-11-10 01:17:36 +01:00
parent c661a4b30b
commit 94cfaf40e5
10 changed files with 306 additions and 99 deletions

View File

@@ -7,9 +7,13 @@
import {deviceChords, deviceLayout, deviceSettings, serialPort, syncStatus} from "$lib/serial/connection"
import {deserializeActions} from "$lib/serial/chord"
function undo() {
redoQueue = [$changes.pop()!, ...redoQueue]
changes.update(it => it)
function undo(event: MouseEvent) {
if (event.shiftKey) {
changes.set([])
} else {
redoQueue = [$changes.pop()!, ...redoQueue]
changes.update(it => it)
}
}
function redo() {