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>
41 lines
1.4 KiB
Go
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"`
|
|
}
|