keyblock

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: May 31, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action added in v0.2.1

type Action func(key *Key)

type Key

type Key struct {
	Key     string
	Display string
	// contains filtered or unexported fields
}

func NewKey

func NewKey(key string) *Key

func (*Key) Init

func (k *Key) Init() tea.Cmd

func (*Key) SetAction added in v0.2.1

func (k *Key) SetAction(action Action)

func (*Key) SetDisply

func (k *Key) SetDisply(display string)

func (*Key) SetOnce added in v0.2.1

func (k *Key) SetOnce(b bool)

func (*Key) Update

func (k *Key) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*Key) View

func (k *Key) View() string

type KeysLine

type KeysLine []*Key

func NewKeysLine

func NewKeysLine(keys ...string) KeysLine

func (KeysLine) Init

func (kl KeysLine) Init() tea.Cmd

func (KeysLine) SetAction added in v0.2.1

func (kl KeysLine) SetAction(action Action)

func (KeysLine) SetActionAt added in v0.2.1

func (kl KeysLine) SetActionAt(i int, action Action)

func (KeysLine) SetDisplay added in v0.2.1

func (kl KeysLine) SetDisplay(i int, display string)

func (KeysLine) SetDisplays

func (kl KeysLine) SetDisplays(displays ...string)

func (KeysLine) SetOnce added in v0.2.1

func (kl KeysLine) SetOnce(b bool)

func (KeysLine) Update

func (kl KeysLine) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (KeysLine) View

func (kl KeysLine) View() string

Jump to

Keyboard shortcuts

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