screen

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2025 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Escape = '\x1b'
	Csi    = '['
)

Variables

View Source
var ErrNotSeq error = errors.New("Not a valid escape sequence")

Functions

This section is empty.

Types

type Event

type Event struct {
	E ScreenEvent
	// contains filtered or unexported fields
}

func ParseSeq

func ParseSeq(b []byte) (*Event, error)

func (*Event) Pos

func (e *Event) Pos() *Position

func (*Event) Rune

func (e *Event) Rune() *rune

func (*Event) Seq

func (e *Event) Seq() string

type Position

type Position struct{ X, Y int }

type Screen

type Screen struct {
	Debug bool

	Q chan *Event
	// contains filtered or unexported fields
}

func (*Screen) Cleanup

func (s *Screen) Cleanup()

func (*Screen) Clear

func (s *Screen) Clear()

func (*Screen) GetSize

func (s *Screen) GetSize()

Results in NewSize Event to Screen.Q

func (*Screen) PrintAt

func (s *Screen) PrintAt(p Position, v ...any)

func (*Screen) PrintDebug

func (s *Screen) PrintDebug(v ...any)

func (*Screen) PrintStatus

func (s *Screen) PrintStatus(v ...any)

func (*Screen) Raw

func (s *Screen) Raw() bool

func (*Screen) SetSize

func (s *Screen) SetSize(p Position)

func (*Screen) Size

func (s *Screen) Size() *Position

func (*Screen) Start

func (s *Screen) Start()

type ScreenEvent

type ScreenEvent byte
const (
	NewSize ScreenEvent = iota
	Char    ScreenEvent = iota

	ArrowUp    ScreenEvent = 'A'
	ArrowDown  ScreenEvent = 'B'
	ArrowRight ScreenEvent = 'C'
	ArrowLeft  ScreenEvent = 'D'
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳