keys

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 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.

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

type Context

type Context string
const (
	Global   Context = "global"
	List     Context = "list"
	Question Context = "question"
	Review   Context = "review"
	Plan     Context = "plan"
)

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.

Jump to

Keyboard shortcuts

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