gui/pkg/keybinding/messages.go
Snider 13a493f57d
Some checks failed
Security Scan / security (push) Failing after 26s
Test / test (push) Failing after 56s
refactor(ax): AX compliance sweep — comments, error handling, test names
- Fix window/service.go: replace 3 fmt.Errorf calls with coreerr.E() (removes implicit fmt dependency)
- Add usage-example comments to all bare Register() functions across 10 packages
- Remove redundant prose comments (Options/Service/Register/OnStartup/HandleIPCEvents boilerplate)
- Add Result-type comments to message types in contextmenu, keybinding, notification packages
- Fix test naming to TestFilename_Function_{Good,Bad,Ugly} pattern in display_test, window_test, persistence_test, service_screen_test
- Convert New() and CreateWindowOptions doc comments to usage-example style

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-31 12:18:41 +01:00

30 lines
866 B
Go

package keybinding
import "errors"
var ErrorAlreadyRegistered = errors.New("keybinding: accelerator already registered")
// BindingInfo describes a registered global key binding.
type BindingInfo struct {
Accelerator string `json:"accelerator"`
Description string `json:"description"`
}
// QueryList returns all registered key bindings. Result: []BindingInfo
type QueryList struct{}
// TaskAdd registers a global key binding. Error: ErrorAlreadyRegistered if accelerator taken.
type TaskAdd struct {
Accelerator string `json:"accelerator"`
Description string `json:"description"`
}
// TaskRemove unregisters a global key binding by accelerator.
type TaskRemove struct {
Accelerator string `json:"accelerator"`
}
// ActionTriggered is broadcast when a registered key binding fires.
type ActionTriggered struct {
Accelerator string `json:"accelerator"`
}