keys

package
v0.0.0-...-e923f38 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Bindings = KeyMap{
		Model: help.New(),
		Help: key.NewBinding(
			key.WithKeys("?"),
			key.WithHelp("?", "toggle help"),
		),
		Quit: key.NewBinding(
			key.WithKeys("q", "esc", "ctrl+c"),
			key.WithHelp("q", "quit"),
		),
	}
)

Functions

This section is empty.

Types

type History

type History []string

func NewHistory

func NewHistory() History

func (History) Add

func (history History) Add(msg tea.Msg) History

func (History) View

func (history History) View() string

type KeyMap

type KeyMap struct {
	help.Model
	Up    key.Binding
	Down  key.Binding
	Left  key.Binding
	Right key.Binding
	Help  key.Binding
	Quit  key.Binding
}

KeyMap defines a set of keybindings. To work for help it must satisfy key.Map. It could also very easily be a map[string]key.Binding.

func (KeyMap) FullHelp

func (k KeyMap) FullHelp() [][]key.Binding

FullHelp returns keybindings for the expanded help view. It's part of the key.Map interface.

func (KeyMap) ShortHelp

func (k KeyMap) ShortHelp() []key.Binding

ShortHelp returns keybindings to be shown in the mini help view. It's part of the key.Map interface.

func (KeyMap) View

func (k KeyMap) View() string

Jump to

Keyboard shortcuts

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