keys

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 13, 2026 License: Apache-2.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

View Source
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>).

View Source
var ErrReserved = errors.New("key is reserved by the core")

Functions

func Canonical

func Canonical(key string) (string, error)

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.

func CheckView added in v0.3.0

func CheckView(key string) error

CheckView refuses a view's key: not a chord of a chord prefix, or a core key on a screen.

func Reserved

func Reserved(s Surface) map[string]bool

Reserved is every Core key on s, every chord prefix ("g"), every lowercase ASCII letter and digit.

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
}

func Views added in v0.3.0

func Views(vs []View) []Binding

Views are the bindings that jump to the views of vs that have a key, in their order, on the screens.

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
const (
	Web     Surface = "web"
	TUI     Surface = "tui"
	Menubar Surface = "menubar"
)

func SurfacesOf

func SurfacesOf(actionSurfaces []string) []Surface

SurfacesOf maps the surfaces of an action spec (row, detail, tui, menubar, ...) to the keyboard surfaces they reach.

type View added in v0.3.0

type View struct{ ID, Key string }

View is a view the catalog serves: its id and the key that jumps to it, "" for none.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL