Manage app.ts litegraph keybindings (#1151)

* Manage app.ts litegraph keybindings

* nit
This commit is contained in:
Chenlei Hu
2024-10-07 16:50:58 -04:00
committed by GitHub
parent ff1ca268a4
commit cc17bee945
6 changed files with 159 additions and 77 deletions

View File

@@ -12,7 +12,12 @@ export const zKeyCombo = z.object({
// Keybinding schema
export const zKeybinding = z.object({
commandId: z.string(),
combo: zKeyCombo
combo: zKeyCombo,
// Optional target element CSS selector to limit keybinding to.
// Note: Currently only used to distinguish between global keybindings
// and litegraph canvas keybindings.
// Do NOT use this field in extensions as it has no effect.
targetSelector: z.string().optional()
})
// Infer types from schemas