Documentation
¶
Index ¶
- Constants
- Variables
- func Backspace(n int)
- func BindKeyFunc(keyName string, funcValue KeyFuncT) error
- func BindKeySymbol(keyName, funcName string) error
- func BindKeySymbolFunc(keyName, funcName string, funcValue KeyFuncT) error
- func BoxPrint(nodes []string, out io.Writer)
- func Cls()
- func DisableCtrlC()
- func GetCh() rune
- func GetCharWidth(n rune) int
- func GetKey() (rune, uint16, uint32)
- func GetLocate() (int, int)
- func GetScreenBufferInfo() *consoleScreenBufferInfo
- func GetStringWidth(s string) int
- func Locate(x, y int)
- func PutRune(ch rune)
- func PutRunes(ch rune, n int)
- func QuotedFirstWord(line string) string
- func ReadLinePromptStr(promptStr string) (string, error)
- func SetCharWidth(c rune, width int)
- func SetTitle(title string)
- func SplitQ(line string) []string
- type Buffer
- func (this *Buffer) CurrentWord() (string, int)
- func (this *Buffer) CurrentWordTop() (wordTop int)
- func (this *Buffer) Delete(pos int, n int) int
- func (this *Buffer) GetWidthBetween(from int, to int) int
- func (this *Buffer) Insert(pos int, c []rune)
- func (this *Buffer) InsertAndRepaint(str string)
- func (this *Buffer) InsertString(pos int, s string) int
- func (this *Buffer) Repaint(pos int, del int)
- func (this *Buffer) RepaintAll()
- func (this *Buffer) ReplaceAndRepaint(pos int, str string)
- func (this Buffer) String() string
- type HistoryLine
- type KeyFuncT
- type KeyGoFuncT
- type LineEditor
- func (this *LineEditor) GetHistoryAt(n int) *HistoryLine
- func (this *LineEditor) HistoryLen() int
- func (this *LineEditor) HistoryPush(input string)
- func (this *LineEditor) HistoryResetPointer()
- func (this *LineEditor) LastHistory() *HistoryLine
- func (session *LineEditor) ReadLine() (string, error)
- func (this *LineEditor) SetPromptStr(prompt string)
- func (this *LineEditor) ShrinkHistory()
- type LineEditorAbort
- type Result
- func KeyFuncBackSpace(this *Buffer) Result
- func KeyFuncBackword(this *Buffer) Result
- func KeyFuncCLS(this *Buffer) Result
- func KeyFuncClear(this *Buffer) Result
- func KeyFuncClearAfter(this *Buffer) Result
- func KeyFuncClearBefore(this *Buffer) Result
- func KeyFuncDelete(this *Buffer) Result
- func KeyFuncDeleteOrAbort(this *Buffer) Result
- func KeyFuncEnter(this *Buffer) Result
- func KeyFuncForward(this *Buffer) Result
- func KeyFuncHead(this *Buffer) Result
- func KeyFuncHistoryDown(this *Buffer) Result
- func KeyFuncHistoryUp(this *Buffer) Result
- func KeyFuncIncSearch(this *Buffer) Result
- func KeyFuncInsertReport(this *Buffer) Result
- func KeyFuncInsertSelf(this *Buffer) Result
- func KeyFuncIntr(this *Buffer) Result
- func KeyFuncPass(this *Buffer) Result
- func KeyFuncPaste(this *Buffer) Result
- func KeyFuncSwapChar(this *Buffer) Result
- func KeyFuncTail(this *Buffer) Result
- func KeyFuncWordRubout(this *Buffer) Result
Constants ¶
View Source
const ( RIGHT_ALT_PRESSED = 1 LEFT_ALT_PRESSED = 2 RIGHT_CTRL_PRESSED = 4 LEFT_CTRL_PRESSED = 8 CTRL_PRESSED = RIGHT_CTRL_PRESSED | LEFT_CTRL_PRESSED ALT_PRESSED = RIGHT_ALT_PRESSED | LEFT_ALT_PRESSED )
View Source
const ( K_BACKSPACE = "BACKSPACE" K_CAPSLOCK = "CAPSLOCK" K_CLEAR = "CLEAR" K_CTRL = "CTRL" K_CTRL_A = "C_A" K_CTRL_B = "C_B" K_CTRL_BREAK = "C_BREAK" K_CTRL_C = "C_C" K_CTRL_D = "C_D" K_CTRL_E = "C_E" K_CTRL_F = "C_F" K_CTRL_G = "C_G" K_CTRL_H = "C_H" K_CTRL_I = "C_I" K_CTRL_J = "C_J" K_CTRL_K = "C_K" K_CTRL_L = "C_L" K_CTRL_M = "C_M" K_CTRL_N = "C_N" K_CTRL_O = "C_O" K_CTRL_P = "C_P" K_CTRL_Q = "C_Q" K_CTRL_R = "C_R" K_CTRL_S = "C_S" K_CTRL_T = "C_T" K_CTRL_U = "C_U" K_CTRL_V = "C_V" K_CTRL_W = "C_W" K_CTRL_X = "C_X" K_CTRL_Y = "C_Y" K_CTRL_Z = "C_Z" K_DELETE = "DEL" K_DOWN = "DOWN" K_END = "END" K_ENTER = "ENTER" K_ESCAPE = "ESCAPE" K_F1 = "F1" K_F10 = "F10" K_F11 = "F11" K_F12 = "F12" K_F13 = "F13" K_F14 = "F14" K_F15 = "F15" K_F16 = "F16" K_F17 = "F17" K_F18 = "F18" K_F19 = "F19" K_F2 = "F2" K_F20 = "F20" K_F21 = "F21" K_F22 = "F22" K_F23 = "F23" K_F24 = "F24" K_F3 = "F3" K_F4 = "F4" K_F5 = "F5" K_F6 = "F6" K_F7 = "F7" K_F8 = "F8" K_F9 = "F9" K_HOME = "HOME" K_LEFT = "LEFT" K_PAGEDOWN = "PAGEDOWN" K_PAGEUP = "PAGEUP" K_PAUSE = "PAUSE" K_RIGHT = "RIGHT" K_SHIFT = "SHIFT" K_UP = "UP" K_ALT_A = "M_A" K_ALT_B = "M_B" K_ALT_BREAK = "M_BREAK" K_ALT_C = "M_C" K_ALT_D = "M_D" K_ALT_E = "M_E" K_ALT_F = "M_F" K_ALT_G = "M_G" K_ALT_H = "M_H" K_ALT_I = "M_I" K_ALT_J = "M_J" K_ALT_K = "M_K" K_ALT_L = "M_L" K_ALT_M = "M_M" K_ALT_N = "M_N" K_ALT_O = "M_O" K_ALT_P = "M_P" K_ALT_Q = "M_Q" K_ALT_R = "M_R" K_ALT_S = "M_S" K_ALT_T = "M_T" K_ALT_U = "M_U" K_ALT_V = "M_V" K_ALT_W = "M_W" K_ALT_X = "M_X" K_ALT_Y = "M_Y" K_ALT_Z = "M_Z" )
View Source
const ( F_ACCEPT_LINE = "ACCEPT_LINE" F_BACKWARD_CHAR = "BACKWARD_CHAR" F_BACKWARD_DELETE_CHAR = "BACKWARD_DELETE_CHAR" F_BEGINNING_OF_LINE = "BEGINNING_OF_LINE" F_CLEAR_SCREEN = "CLEAR_SCREEN" F_DELETE_CHAR = "DELETE_CHAR" F_DELETE_OR_ABORT = "DELETE_OR_ABORT" F_END_OF_LINE = "END_OF_LINE" F_FORARD_CHAR = "FORWARD_CHAR" F_HISTORY_DOWN = "HISTORY_DOWN" F_HISTORY_UP = "HISTORY_UP" F_INTR = "INTR" F_ISEARCH_BACKWARD = "ISEARCH_BACKWARD" F_KILL_LINE = "KILL_LINE" F_KILL_WHOLE_LINE = "KILL_WHOLE_LINE" F_PASS = "PASS" F_REPAINT = "REPAINT" F_SWAPCHAR = "SWAPCHAR" F_UNIX_LINE_DISCARD = "UNIX_LINE_DISCARD" F_UNIX_WORD_RUBOUT = "UNIX_WORD_RUBOUT" F_YANK = "YANK" )
View Source
const CTRL_CLOSE_EVENT = 2
View Source
const CTRL_C_EVENT = 0
View Source
const CTRL_LOGOFF_EVENT = 5
View Source
const CTRL_SHUTDOWN_EVENT = 6
View Source
const ENABLE_ECHO_INPUT = 4
View Source
const ENABLE_PROCESSED_INPUT = 1
View Source
const KEY_EVENT = 1
View Source
const NULQUOTE = '\000'
View Source
const STD_INPUT_HANDLE = (uint32)(0xfffffff6)
View Source
const STD_OUTPUT_HANDLE = (uint32)(0xfffffff5)
Variables ¶
View Source
var DefaultEditor = NewLineEditor()
View Source
var Delimiters = "\"'"
Functions ¶
func BindKeyFunc ¶
func BindKeySymbol ¶
func BindKeySymbolFunc ¶
func DisableCtrlC ¶
func DisableCtrlC()
func GetCharWidth ¶
func GetScreenBufferInfo ¶
func GetScreenBufferInfo() *consoleScreenBufferInfo
func GetStringWidth ¶
func QuotedFirstWord ¶
func ReadLinePromptStr ¶
Not used on NYAGOS. Provide this as library for other applications.
func SetCharWidth ¶
Types ¶
type Buffer ¶
type Buffer struct { Buffer []rune Length int Cursor int Unicode rune Keycode uint16 ShiftState uint32 ViewStart int ViewWidth int Session *LineEditor }
func (*Buffer) CurrentWord ¶
func (*Buffer) CurrentWordTop ¶
func (*Buffer) InsertAndRepaint ¶
func (*Buffer) RepaintAll ¶
func (this *Buffer) RepaintAll()
func (*Buffer) ReplaceAndRepaint ¶
type HistoryLine ¶
func NewHistoryLine ¶
func NewHistoryLine(line string) *HistoryLine
func (*HistoryLine) At ¶
func (this *HistoryLine) At(n int) string
type KeyGoFuncT ¶
func (*KeyGoFuncT) Call ¶
func (this *KeyGoFuncT) Call(buffer *Buffer) Result
type LineEditor ¶
type LineEditor struct { Histories []*HistoryLine Pointer int Prompt func(*LineEditor) (int, error) Tag interface{} }
func NewLineEditor ¶
func NewLineEditor() *LineEditor
func (*LineEditor) GetHistoryAt ¶
func (this *LineEditor) GetHistoryAt(n int) *HistoryLine
func (*LineEditor) HistoryLen ¶
func (this *LineEditor) HistoryLen() int
func (*LineEditor) HistoryPush ¶
func (this *LineEditor) HistoryPush(input string)
func (*LineEditor) HistoryResetPointer ¶
func (this *LineEditor) HistoryResetPointer()
func (*LineEditor) LastHistory ¶
func (this *LineEditor) LastHistory() *HistoryLine
func (*LineEditor) ReadLine ¶
func (session *LineEditor) ReadLine() (string, error)
Call LineEditor - ENTER typed -> returns TEXT and nil - CTRL-C typed -> returns "" and nil - CTRL-D typed -> returns "" and LineEditorAbort
func (*LineEditor) SetPromptStr ¶
func (this *LineEditor) SetPromptStr(prompt string)
func (*LineEditor) ShrinkHistory ¶
func (this *LineEditor) ShrinkHistory()
type LineEditorAbort ¶
type LineEditorAbort struct{}
func (*LineEditorAbort) Error ¶
func (this *LineEditorAbort) Error() string
type Result ¶
type Result int
func KeyFuncBackSpace ¶
func KeyFuncBackword ¶
func KeyFuncCLS ¶
func KeyFuncClear ¶
func KeyFuncClearAfter ¶
func KeyFuncClearBefore ¶
func KeyFuncDelete ¶
func KeyFuncDeleteOrAbort ¶
func KeyFuncEnter ¶
func KeyFuncForward ¶
func KeyFuncHead ¶
func KeyFuncHistoryDown ¶
func KeyFuncHistoryUp ¶
func KeyFuncIncSearch ¶
func KeyFuncInsertReport ¶
func KeyFuncInsertSelf ¶
func KeyFuncIntr ¶
func KeyFuncPass ¶
func KeyFuncPaste ¶
func KeyFuncSwapChar ¶
func KeyFuncTail ¶
func KeyFuncWordRubout ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.