gui/pkg/keybinding/messages.go
Claude a9b795f223
Some checks failed
Security Scan / security (push) Failing after 29s
Test / test (push) Successful in 2m9s
feat: Wails v3 stub bridge + feature expansion + display bridge + MCP events
Stubs (15 files, 479 exports):
- All managers: Dialog, Event, Browser, Clipboard, ContextMenu, Environment, Screen, KeyBinding
- Window interface (~50 methods), BrowserWindow, platform options (iOS/Android)
- MenuItem (42 roles), WebviewWindowOptions (full platform types)
- Wails v3 submodule pinned at alpha 74

New events package (17th package):
- Custom event system bridged to Core IPC
- TaskEmit, TaskOn, TaskOff, QueryListeners, ActionEventFired

Feature expansions:
- Window: zoom, content (SetURL/SetHTML/ExecJS), bounds, print, flash
- Screen: QueryCurrent, ScreenPlacement, Rect geometry
- Dialog: typed tasks, file options, Info/Question/Warning/Error
- Keybinding: TaskProcess, ErrorNotRegistered
- Notification: RevokePermission, RegisterCategory, action broadcasts
- Dock: SetProgressBar, Bounce/StopBounce
- Environment: HasFocusFollowsMouse
- ContextMenu: QueryGetAll, TaskUpdate, TaskDestroy

Display bridge: 5 new event types wired to WebSocket
MCP: 4 event tools (emit, on, off, list)

17 packages build and test clean (1 flaky test ordering issue in window).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 17:42:09 +01:00

41 lines
1.4 KiB
Go

package keybinding
import coreerr "forge.lthn.ai/core/go-log"
// ErrorAlreadyRegistered is returned by TaskAdd when the accelerator is already bound.
var ErrorAlreadyRegistered = coreerr.NewError("keybinding: accelerator already registered")
// ErrorNotRegistered is returned by TaskRemove and TaskProcess when the accelerator is unknown.
var ErrorNotRegistered = coreerr.NewError("keybinding: accelerator not 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"`
}
// TaskProcess programmatically triggers a registered key binding as if the user pressed it.
// Error: ErrorNotRegistered if the accelerator has not been registered.
// _, _, err := c.PERFORM(TaskProcess{Accelerator: "Ctrl+S"})
type TaskProcess struct {
Accelerator string `json:"accelerator"`
}
// ActionTriggered is broadcast when a registered key binding fires.
type ActionTriggered struct {
Accelerator string `json:"accelerator"`
}