conio

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

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

Go to latest
Published: Dec 16, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KeyEscape   = 27
	KeyEsc      = KeyEscape
	KeyDown     = 65516
	KeyUp       = 65517
	KeyLeft     = 65515
	KeyRight    = 65514
	KeyHome     = 65521
	KeyEnd      = 65520
	KeyPageUp   = 65519
	KeyPgUp     = KeyPageUp
	KeyPageDown = 65518
	KeyPgDn     = KeyPageDown
)

KeyEscape -

View Source
const (
	AlignLeft = TAlignment(iota)
	AlignRight
	AlignCenter
)

AlignLeft -

Variables

View Source
var (
	ColorDefault  = TColor{int32(termbox.ColorDefault)}
	ColorBlack    = TColor{int32(termbox.ColorBlack)}
	ColorRed      = TColor{int32(termbox.ColorRed)}
	ColorGreen    = TColor{int32(termbox.ColorGreen)}
	ColorYellow   = TColor{int32(termbox.ColorYellow)}
	ColorBlue     = TColor{int32(termbox.ColorBlue)}
	ColorMagenta  = TColor{int32(termbox.ColorMagenta)}
	ColorCyan     = TColor{int32(termbox.ColorCyan)}
	ColorWhite    = TColor{int32(termbox.ColorWhite)}
	ColorDarkGray = TColor{int32(termbox.ColorBlack | termbox.AttrBold)}
)

Colors -

View Source
var ActionMap tActionMap

ActionMap -

View Source
var BorderMap tBorderMap

BorderMap -

Functions

func Close

func Close()

Close - closes conio

func HandleEvent

func HandleEvent(ev IEvent)

HandleEvent -

func Init

func Init() error

Init - initializes conio

Types

type IAction

type IAction interface {
	Name() string
	EventKey() string
	Description() string
	Do(ev IEvent) bool
}

IAction -

type IEvent

type IEvent interface {
	Time() time.Time
	Type() string
	EventKey() string
	String() string
}

IEvent -

type TAbstractAction

type TAbstractAction struct {
	// contains filtered or unexported fields
}

TAbstractAction -

func (*TAbstractAction) Description

func (act *TAbstractAction) Description() string

Description -

func (*TAbstractAction) Do

func (act *TAbstractAction) Do(ev IEvent) bool

Do -

func (*TAbstractAction) EventKey

func (act *TAbstractAction) EventKey() string

EventKey -

func (*TAbstractAction) Name

func (act *TAbstractAction) Name() string

Name -

type TAction

type TAction struct {
	TAbstractAction
	// contains filtered or unexported fields
}

TAction -

func NewAction

func NewAction(name, eventKey, descr string, handler TEventHandler) *TAction

NewAction -

func (*TAction) Do

func (act *TAction) Do(ev IEvent) bool

Do -

type TAlignment

type TAlignment int

TAlignment -

type TBorder

type TBorder struct {
	LU rune
	H1 rune
	RU rune
	V1 rune
	V2 rune
	LD rune
	H2 rune
	RD rune
}

TBorder -

type TColor

type TColor struct {
	// contains filtered or unexported fields
}

TColor -

type TEvent

type TEvent struct {
	// contains filtered or unexported fields
}

TEvent -

func (*TEvent) Time

func (ev *TEvent) Time() time.Time

Time -

type TEventHandler

type TEventHandler func(ev IEvent) bool

TEventHandler -

type TEventStream

type TEventStream struct {
}

TEventStream -

func EventStream

func EventStream() *TEventStream

EventStream -

func NewEventStream

func NewEventStream() *TEventStream

NewEventStream -

func (*TEventStream) Close

func (evs *TEventStream) Close()

Close -

func (*TEventStream) HasEvent

func (evs *TEventStream) HasEvent() bool

HasEvent - returns true if key was pressed

func (*TEventStream) ReadEvent

func (evs *TEventStream) ReadEvent() IEvent

ReadEvent - reads a key. Blocking

func (*TEventStream) Start

func (evs *TEventStream) Start()

Start -

func (*TEventStream) Stop

func (evs *TEventStream) Stop()

Stop -

type TKeyboardAction

type TKeyboardAction struct {
	TAbstractAction
	// contains filtered or unexported fields
}

TKeyboardAction -

func NewKeyboardAction

func NewKeyboardAction(name, eventKey, descr string, handler TKeyboardHandler) *TKeyboardAction

NewKeyboardAction -

func (*TKeyboardAction) Do

func (act *TKeyboardAction) Do(ev IEvent) bool

Do -

type TKeyboardEvent

type TKeyboardEvent struct {
	TEvent
	// contains filtered or unexported fields
}

TKeyboardEvent -

func (*TKeyboardEvent) EventKey

func (ev *TKeyboardEvent) EventKey() string

EventKey -

func (*TKeyboardEvent) Key

func (ev *TKeyboardEvent) Key() int

Key -

func (*TKeyboardEvent) Mod

func (ev *TKeyboardEvent) Mod() int

Mod -

func (*TKeyboardEvent) Rune

func (ev *TKeyboardEvent) Rune() rune

Rune -

func (*TKeyboardEvent) String

func (ev *TKeyboardEvent) String() string

String -

func (*TKeyboardEvent) Type

func (ev *TKeyboardEvent) Type() string

Type -

type TKeyboardHandler

type TKeyboardHandler func(ev TKeyboardEvent) bool

TKeyboardHandler -

type TMouseEvent

type TMouseEvent struct {
	TEvent
	// contains filtered or unexported fields
}

TMouseEvent -

func (*TMouseEvent) EventKey

func (ev *TMouseEvent) EventKey() string

EventKey -

func (*TMouseEvent) Key

func (ev *TMouseEvent) Key() int

Key -

func (*TMouseEvent) Mod

func (ev *TMouseEvent) Mod() int

Mod -

func (*TMouseEvent) String

func (ev *TMouseEvent) String() string

String -

func (*TMouseEvent) Type

func (ev *TMouseEvent) Type() string

Type -

func (*TMouseEvent) X

func (ev *TMouseEvent) X() int

X -

func (*TMouseEvent) Y

func (ev *TMouseEvent) Y() int

Y -

type TScreen

type TScreen struct {
	// contains filtered or unexported fields
}

TScreen -

func NewScreen

func NewScreen() *TScreen

NewScreen -

func Screen

func Screen() *TScreen

Screen -

func (*TScreen) BgColor

func (scr *TScreen) BgColor() TColor

BgColor -

func (*TScreen) Clear

func (scr *TScreen) Clear(ch rune, fg, bg TColor)

Clear -

func (*TScreen) Close

func (scr *TScreen) Close()

Close -

func (*TScreen) DrawAlignedString

func (scr *TScreen) DrawAlignedString(x, y, w int, str string)

DrawAlignedString -

func (*TScreen) DrawBorder

func (scr *TScreen) DrawBorder(x, y, w, h int)

DrawBorder -

func (*TScreen) DrawRune

func (scr *TScreen) DrawRune(x, y int, ch rune)

DrawRune -

func (*TScreen) DrawString

func (scr *TScreen) DrawString(x, y int, str string)

DrawString -

func (*TScreen) EnableShadow

func (scr *TScreen) EnableShadow(mode bool)

EnableShadow -

func (*TScreen) FgColor

func (scr *TScreen) FgColor() TColor

FgColor -

func (*TScreen) FillRect

func (scr *TScreen) FillRect(x, y, w, h int, ch rune)

FillRect -

func (*TScreen) Flush

func (scr *TScreen) Flush()

Flush -

func (*TScreen) Height

func (scr *TScreen) Height() int

Height -

func (*TScreen) InvertColor

func (scr *TScreen) InvertColor()

InvertColor -

func (*TScreen) MoveCursor

func (scr *TScreen) MoveCursor(x, y int)

MoveCursor -

func (*TScreen) SelectBorder

func (scr *TScreen) SelectBorder(name string)

SelectBorder -

func (*TScreen) SetAlignment

func (scr *TScreen) SetAlignment(alignment TAlignment)

SetAlignment -

func (*TScreen) SetBgColor

func (scr *TScreen) SetBgColor(bg TColor)

SetBgColor -

func (*TScreen) SetCellColor

func (scr *TScreen) SetCellColor(x, y int, fg, bg TColor)

SetCellColor -

func (*TScreen) SetColor

func (scr *TScreen) SetColor(fg, bg TColor)

SetColor -

func (*TScreen) SetFgColor

func (scr *TScreen) SetFgColor(fg TColor)

SetFgColor -

func (*TScreen) ShowCursor

func (scr *TScreen) ShowCursor(enable bool)

ShowCursor -

func (*TScreen) Width

func (scr *TScreen) Width() int

Width -

type TWindowEvent

type TWindowEvent struct {
	TEvent
	// contains filtered or unexported fields
}

TWindowEvent -

func (*TWindowEvent) EventKey

func (ev *TWindowEvent) EventKey() string

EventKey -

func (*TWindowEvent) Size

func (ev *TWindowEvent) Size() (int, int)

Size -

func (*TWindowEvent) String

func (ev *TWindowEvent) String() string

String -

func (*TWindowEvent) Type

func (ev *TWindowEvent) Type() string

Type -

Jump to

Keyboard shortcuts

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