Rebind the studio's keys from a settings dialog

The studio's keys were a fixed table, so the views, map toggles, zoom and node editor undo and redo could not be changed. The keys now come from a store the user rebinds in a settings dialog, saved to studio.json in the app's user data folder; tooltips, the view list, the hover card and the help dialog read the live keys, and a new key that another shortcut already uses is warned about.

v3: 8930afbb3
This commit is contained in:
piexel committed 2026-11-10 12:32:42 +01:00
1 parent eb2113b835
commit a8aaa3c3cf
16 files changed
+698 -75

No files matched your search

+6
View File
@@ -6,6 +6,9 @@ export interface BridgeConnection {
startedMillis?: number
}
/** The keys the user rebound, by shortcut id, each a list of key chords. */
export type StoredShortcuts = Record<string, string[]>
export type ThemeChoice = 'system' | 'light' | 'dark'
/** What the preload script hands the renderer. */
@@ -16,6 +19,9 @@ export interface StudioHost {
onLink(listener: (link: string) => void): () => void
setTheme(theme: ThemeChoice): void
copyText(text: string): void
/** The rebound shortcuts from the studio settings, as the file holds them, for the caller to check. */
loadShortcuts(): Promise<unknown>
saveShortcuts(shortcuts: StoredShortcuts): void
}
const LINK_PROTOCOL = 'iris-studio:'