Documentation
¶
Index ¶
Constants ¶
const ( KeyNull = keyNUL KeyBreak = keyETX KeyEnter = keyCR KeyBackspace = keyBS KeyTab = keyHT KeySpace = keySP KeyEsc = keyESC KeyEscape = keyESC KeyDelete = keyDEL KeyCtrlAt = keyNUL // ctrl+@ KeyCtrlA = keySOH KeyCtrlB = keySTX KeyCtrlC = keyETX KeyCtrlD = keyEOT KeyCtrlE = keyENQ KeyCtrlF = keyACK KeyCtrlG = keyBEL KeyCtrlH = keyBS KeyCtrlI = keyHT KeyCtrlJ = keyLF KeyCtrlK = keyVT KeyCtrlL = keyFF KeyCtrlM = keyCR KeyCtrlN = keySO KeyCtrlO = keySI KeyCtrlP = keyDLE KeyCtrlQ = keyDC1 KeyCtrlR = keyDC2 KeyCtrlS = keyDC3 KeyCtrlT = keyDC4 KeyCtrlU = keyNAK KeyCtrlV = keyETB KeyCtrlW = keyETB KeyCtrlX = keyCAN KeyCtrlY = keyEM KeyCtrlZ = keySUB KeyCtrlOpenBracket = keyESC // ctrl+[ KeyCtrlBackslash = keyFS // ctrl+\ KeyCtrlCloseBracket = keyGS // ctrl+] KeyCtrlCaret = keyRS // ctrl+^ KeyCtrlUnderscore = keyUS // ctrl+_ KeyCtrlQuestionMark = keyDEL // ctrl+? )
Aliases
const ( KeyRune = -(iota + 1) KeyUp KeyDown KeyRight KeyLeft KeyShiftTab KeyHome KeyEnd KeyPgUp KeyPgDown )
Other keys we track
Variables ¶
This section is empty.
Functions ¶
func AltScreen ¶
func AltScreen()
AltScreen exits the altscreen. This is just a wrapper around the termenv function
func ExitAltScreen ¶
func ExitAltScreen()
ExitAltScreen exits the altscreen. This is just a wrapper around the termenv function
Types ¶
type Cmd ¶
type Cmd func() Msg
Cmd is an IO operation that runs once. If it's nil it's considered a no-op.
type Init ¶
Init is the first function that will be called. It returns your initial model and runs an optional command
type KeyMsg ¶
type KeyMsg Key
KeyPressMsg contains information about a keypress
type Msg ¶
type Msg interface{}
Msg represents an action and is usually the result of an IO operation. It's triggers the Update function, and henceforth, the UI.
type NewEveryMsg ¶ added in v0.3.0
NewEveryMsg is used by Every to create a new message. It contains the time at which the timer finished.
type Program ¶
type Program struct {
// contains filtered or unexported fields
}
Program is a terminal user interface
func NewProgram ¶
func NewProgram(init Init, update Update, view View, subs Subscriptions) *Program
NewProgram creates a new Program
type Sub ¶
type Sub func() Msg
Sub is an event subscription; generally a recurring IO operation. If it returns nil it's considered a no-op, but there's really no reason to have a nil subscription.
type Subs ¶
Subs is a keyed set of subscriptions. The key should be a unique identifier: two different subscriptions should not have the same key or weird behavior will occur.
type Subscriptions ¶
Subscriptions returns a map of subscriptions (Subs) our application will subscribe to. If Subscriptions is nil it's considered a no-op.