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.
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 // gtd verb, "nav:<view>", "area:<n>", "answer:<n>", "move:down", "palette", "help", "filter", "open-source", "capture", ...
Context Context
Surfaces []Surface
Help string
}