gui/pkg/keybinding/platform.go

19 lines
756 B
Go
Raw Permalink Normal View History

// pkg/keybinding/platform.go
package keybinding
// Platform abstracts the keyboard shortcut backend (Wails v3).
type Platform interface {
// Add registers a global keyboard shortcut with the given accelerator string.
// The handler is called when the shortcut is triggered.
// Accelerator syntax is platform-aware: "Cmd+S" (macOS), "Ctrl+S" (Windows/Linux).
// Special keys: F1-F12, Escape, Enter, Space, Tab, Backspace, Delete, arrow keys.
Add(accelerator string, handler func()) error
// Remove unregisters a previously registered keyboard shortcut.
Remove(accelerator string) error
// GetAll returns all currently registered accelerator strings.
// Used for adapter-level reconciliation only — not read by QueryList.
GetAll() []string
}