key

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModAlt   = "alt+"
	ModCtrl  = "ctrl+"
	ModShift = "shift+"
)
View Source
const (
	AltEnter = ModAlt + Enter

	CtrlA = ModCtrl + "a"
	CtrlB = ModCtrl + "b"
	CtrlC = ModCtrl + "c"
	CtrlD = ModCtrl + "d"
	CtrlF = ModCtrl + "f"
)
View Source
const (
	N     = "n"
	Down  = "down"
	Enter = "enter"
	Esc   = "esc"
	Left  = "left"
	Right = "right"
	Space = "space"
	Tab   = "tab"
	Up    = "up"
	Y     = "y"
)
View Source
const (
	ShiftDown = ModShift + Down
	ShiftUp   = ModShift + Up
	ShiftTab  = ModShift + Tab
)
View Source
const (
	ArrowsLeftRight   = "←→"
	ArrowsUpDown      = "↑↓"
	ShiftArrowsUpDown = ModShift + ArrowsUpDown
)

Variables

This section is empty.

Functions

func Inline

func Inline(key, desc string, keyStyle, textStyle lg.Style) (string, bool)

Inline highlights the key inside the description when it is a single-letter suffix.

Types

type Hint

type Hint struct {
	Key  string
	Desc string
}

type Renderer

type Renderer struct {
	Styles Styles
	Gap    string
	Prefix *string
	Width  int
	Inline bool
}

func (Renderer) Render

func (r Renderer) Render(hints []Hint) string

type Styles

type Styles struct {
	Key  lg.Style
	Text lg.Style
}

Jump to

Keyboard shortcuts

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