keymap.go

 1package keymap
 2
 3import "github.com/charmbracelet/bubbles/key"
 4
 5// KeyMap is a map of key bindings for the UI.
 6type KeyMap struct {
 7	Quit key.Binding
 8}
 9
10// DefaultKeyMap returns the default key map.
11func DefaultKeyMap() *KeyMap {
12	km := new(KeyMap)
13
14	km.Quit = key.NewBinding(
15		key.WithKeys(
16			"ctrl-c",
17			"q",
18		),
19		key.WithHelp(
20			"q",
21			"quit",
22		),
23	)
24
25	return km
26}