controls

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: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Menu interface {
	Event(ev tcell.Event)
	Draw(tcell.Screen)
}

func NewMenu

func NewMenu(items []MenuItem, controls MenuControls, defaultIndex int) Menu
type MenuControls struct {
	First rune
	Last  rune

	Prev rune
	Next rune

	Select tcell.Key
}
var DefaultHorizontalMenuControls MenuControls = MenuControls{
	First: 'A',
	Last:  'D',

	Prev: 'a',
	Next: 'd',

	Select: tcell.KeyEnter,
}
var DefaultVerticalMenuControls MenuControls = MenuControls{
	First: 'W',
	Last:  'S',

	Prev: 'w',
	Next: 's',

	Select: tcell.KeyEnter,
}
type MenuItem interface {
	Active() bool
	SetActive(bool)

	Emitter() <-chan struct{}
	SetSelected()

	Draw(tcell.Screen)
}

func NewMenuItem

func NewMenuItem(active, inactive visual.CellGroup) MenuItem

type Mimic

type Mimic interface {
	Event(ev tcell.Event)
	Draw(screen tcell.Screen)
}

func NewMimic

func NewMimic(pos position.Position, style tcell.Style, cursor visual.Cursor) Mimic

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳