keybind

package
v0.0.0-...-d88343e Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2020 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AllBindings

type AllBindings struct {
	VerticalMenu MenuBinding
}
var DefaultAllBindings AllBindings = AllBindings{
	HorizontalMenu: DefaultHorizontalMenuBinding,
	VerticalMenu:   DefaultVerticalMenuBinding,
}

type Binding

type Binding struct {
	Key       tcell.Key
	Modifiers tcell.ModMask
	Name      string
	Rune      rune
}

func BindingFromEventKey

func BindingFromEventKey(eventKey tcell.EventKey) Binding

func (Binding) Matches

func (b Binding) Matches(eventKey tcell.EventKey) bool
type MenuBinding struct {
	First Binding
	Last  Binding
	Next  Binding
	Prev  Binding
}
var DefaultHorizontalMenuBinding MenuBinding = MenuBinding{
	First: Binding{Key: tcell.KeyRune, Name: "A", Rune: 'A'},
	Last:  Binding{Key: tcell.KeyRune, Name: "D", Rune: 'D'},
	Next:  Binding{Key: tcell.KeyRune, Name: "d", Rune: 'd'},
	Prev:  Binding{Key: tcell.KeyRune, Name: "a", Rune: 'a'},
}
var DefaultVerticalMenuBinding MenuBinding = MenuBinding{
	First: Binding{Key: tcell.KeyRune, Name: "W", Rune: 'W'},
	Last:  Binding{Key: tcell.KeyRune, Name: "S", Rune: 'S'},
	Next:  Binding{Key: tcell.KeyRune, Name: "s", Rune: 's'},
	Prev:  Binding{Key: tcell.KeyRune, Name: "w", Rune: 'w'},
}

Jump to

Keyboard shortcuts

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