tui

package
v0.0.0-...-9ba8c3f Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2022 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Keys = KeyMap{
	Exit: key.NewBinding(
		key.WithKeys("ctrl+c"),
		key.WithHelp("ctrl+c", "exit"),
	),
	PlayPause: key.NewBinding(
		key.WithKeys(" "),
		key.WithHelp("space", "Play/Pause"),
	),
	AddToQueue: key.NewBinding(
		key.WithKeys("enter"),
		key.WithHelp("enter", "Add to Queue"),
	),
	FocusToInput: key.NewBinding(
		key.WithKeys("ctrl+a"),
		key.WithHelp("ctrl+a", "Focus on Input"),
	),
	SeekForward: key.NewBinding(
		key.WithKeys("right"),
		key.WithHelp("right", "Seek Forward"),
	),
	SeekBackward: key.NewBinding(
		key.WithKeys("left"),
		key.WithHelp("left", "Seek Backward"),
	),
	NextSong: key.NewBinding(
		key.WithKeys("ctrl+right"),
		key.WithHelp("ctrl+right", "Next Song"),
	),
	PrevSong: key.NewBinding(
		key.WithKeys("ctrl+left"),
		key.WithHelp("ctrl+left", "Next Song"),
	),
	Help: key.NewBinding(
		key.WithKeys("?"),
		key.WithHelp("?", "toggle help"),
	),
}

DefaultKeyMap returns a set of default keybindings.

Functions

This section is empty.

Types

type KeyMap

type KeyMap struct {
	Exit         key.Binding
	PlayPause    key.Binding
	AddToQueue   key.Binding
	FocusToInput key.Binding
	SeekForward  key.Binding
	SeekBackward key.Binding
	NextSong     key.Binding
	PrevSong     key.Binding
	Help         key.Binding
}

func (KeyMap) FullHelp

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

func (KeyMap) ShortHelp

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

type Model

type Model struct {
	// contains filtered or unexported fields
}

func InitialModel

func InitialModel() Model

func (Model) Init

func (m Model) Init() tea.Cmd

func (Model) Update

func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update Method

func (Model) View

func (m Model) View() string

View Method

Jump to

Keyboard shortcuts

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