Documentation
¶
Overview ¶
Package keys is the one keyboard map of every surface: the core bindings and the rule plugin and intent keys follow.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Core = core()
Core are the core bindings of spec 9.2. The keys that jump to a view are the catalog's (Views); a digit in a gate runs the gate's intent of that order (answer:<n>).
var ErrReserved = errors.New("key is reserved by the core")
Functions ¶
func Canonical ¶
Canonical turns a key name into its canonical form ("shift+r" -> "R"); it rejects unknown names.
func Check ¶
func Check(s Surface, key, owner string, claimed map[string]string, toggles map[string]string) error
Check refuses a plugin or intent key: not one character of A-Z, or reserved on s, or taken on s by an owner that is not its toggle pair. claimed maps key -> owner id; toggles maps an action id to its Toggle partner. The error names the key, the surface and the owner.
Types ¶
type Binding ¶
type Binding struct {
Key string // canonical: "x", "X" (Shift+x), "Enter", "Esc", "Backspace", "Tab", "Ctrl+K", "Cmd+K", "?", "/", "g f", "1".."9", "Shift+1".."Shift+9"
Action string // task verb, "nav:<view>", "area:<n>", "answer:<n>", "move:down", "palette", "help", "filter", "open-source", "capture", ...
Context Context
Surfaces []Surface
}
type Context ¶
type Context string
const ( Global Context = "global" List Context = "list" Question Context = "question" Review Context = "review" Plan Context = "plan" // Detail is the detail panel of a task, where the focus is inside it. Detail Context = "detail" // Queue is a decision queue, which shows one decision at a time. Queue Context = "queue" )
type Surface ¶
type Surface string
func SurfacesOf ¶
SurfacesOf maps the surfaces of an action spec (row, detail, tui, menubar, ...) to the keyboard surfaces they reach.