terminal

package
v0.0.0-...-0e5ea14 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KeyNoSpl      = iota
	KeyArrowLeft  = iota + 999 //ARROW_LEFT //KeyArrowLeft
	KeyArrowRight              //ARROW_RIGHT //KeyArrowRight
	KeyArrowUp                 //ARROW_UP //KeyArrowUp
	KeyArrowDown               //ARROW_DOWN //KeyArrowDown
	KeyDelete                  //DEL_KEY //KeyDelete
	KeyHome                    //HOME_KEY //KeyHome
	KeyEnd                     //END_KEY //KeyEnd
	KeyPageUp                  //PAGE_UP //KeyPageUp
	KeyPageDown                //PAGE_DOWN //KeyPageDown
	KeyF1
	KeyF2
	KeyF3
	KeyF4
	KeyF5
	KeyF6
	KeyF7
	KeyF8
	KeyF9
	KeyF10
	KeyF11
	KeyF12
	KeyIns
)

Special keys

Variables

View Source
var ErrNoInput = fmt.Errorf("no input")

ErrNoInput indicates that there is no input when reading from keyboard in raw mode. This happens when timeout is set to a low number

Functions

This section is empty.

Types

type Key

type Key struct {
	Regular rune
	Special int
}

Key represents the key entered by the user

func ReadKey

func ReadKey() (Key, error)

ReadKey reads a key from Stdin processing it for VT100 sequences. Stdin should be put in raw mode with VT100 processing enabled prior to using RawReadKey. If terminal read is set to timeout mode and no key is pressed, then ErrNoInput will be returned

Jump to

Keyboard shortcuts

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