Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InstallASCIICodeParse ¶
func InstallASCIICodeParse(codes ...*ASCIICode)
InstallASCIICodeParse install ascii code parse. NOTE: it must call in init func
Types ¶
type ConsoleParser ¶
type ConsoleParser interface { // Setup should be called before starting input Setup() error // TearDown should be called after stopping input TearDown() error // GetWinSize returns WinSize object to represent width and height of terminal. GetWinSize() *WinSize // Read returns byte array. Read() ([]byte, error) }
ConsoleParser is an interface to abstract input layer.
type Key ¶
type Key uint64
Key is the type express the key inserted from user.
const ( Escape Key = iota ControlA ControlB ControlC ControlD ControlE ControlF ControlG ControlH ControlK ControlL ControlN ControlO ControlP ControlQ ControlR ControlS ControlT ControlU ControlV ControlW ControlX ControlY ControlZ // Meta[Alt] + [a-f] MetaA MetaB MetaC MetaD MetaE MetaF MetaG MetaH MetaI MetaJ MetaK MetaL MetaM MetaN MetaO MetaP MetaQ MetaR MetaS MetaT MetaU MetaV MetaW MetaX MetaY MetaZ // Meta[Alt] + Shift [a-z] // Meta[Alt] + [A-Z] MetaShiftA MetaShiftB MetaShiftC MetaShiftD MetaShiftE MetaShiftF MetaShiftG MetaShiftH MetaShiftI MetaShiftJ MetaShiftK MetaShiftL MetaShiftM MetaShiftN MetaShiftO MetaShiftP MetaShiftQ MetaShiftR MetaShiftS MetaShiftT MetaShiftU MetaShiftV MetaShiftW MetaShiftX MetaShiftY MetaShiftZ ControlSpace ControlBackslash ControlSquareClose ControlCircumflex ControlUnderscore ControlLeft ControlRight ControlUp ControlDown Up Down Right Left ShiftLeft ShiftUp ShiftDown ShiftRight Home End Delete ShiftDelete ControlDelete PageUp PageDown BackTab Insert Backspace // Aliases. Tab Enter F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 F13 F14 F15 F16 F17 F18 F19 F20 F21 F22 F23 F24 // Matches any key. Any // Special CPRResponse Vt100MouseEvent WindowsMouseEvent BracketedPaste // Key which is ignored. (The key binding for this key should not do anything.) Ignore // Key is not defined NotDefined )
type PosixParser ¶
type PosixParser struct {
// contains filtered or unexported fields
}
PosixParser is a ConsoleParser implementation for POSIX environment.
func NewStandardInputParser ¶
func NewStandardInputParser() *PosixParser
NewStandardInputParser returns ConsoleParser object to read from stdin.
func (*PosixParser) GetWinSize ¶
func (t *PosixParser) GetWinSize() *WinSize
GetWinSize returns WinSize object to represent width and height of terminal.
func (*PosixParser) Setup ¶
func (t *PosixParser) Setup() error
Setup should be called before starting input
func (*PosixParser) TearDown ¶
func (t *PosixParser) TearDown() error
TearDown should be called after stopping input
Click to show internal directories.
Click to hide internal directories.