cterm

package
v0.0.0-...-59848b6 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KeyArrowUp = Key(iota + 1000)
	KeyArrowDown
	KeyArrowRight
	KeyArrowLeft
	KeyEnter
	KeyEsc
	KeyBackspace2
	KeyCtrlA
	KeyCtrlC
	KeyCtrlD
	KeyCtrlE
	KeyCtrlK
	KeyCtrlV
	KeyF3
	KeyF7
	KeyF8
	KeyF9
	KeyF10
)

Keys codes.

Variables

This section is empty.

Functions

func Close

func Close()

func Flush

func Flush() error

func Init

func Init() error

func Interrupt

func Interrupt()

Interrupt posts an interrupt event.

func SetCell

func SetCell(x, y int, ch rune, fg, bg Attribute)

SetCell sets the character cell at a given location to the given content (rune) and attributes.

func SetProvider

func SetProvider(p Provider)

func Size

func Size() (int, int)

func Sync

func Sync() error

Types

type Attribute

type Attribute uint64

Attribute affects the presentation of characters, such as color, boldness, and so forth.

const (
	ColorDefault Attribute = iota
	ColorBlack
	ColorRed
	ColorGreen
	ColorYellow
	ColorBlue
	ColorMagenta
	ColorCyan
	ColorWhite
	ColorDarkGray
	ColorLightRed
	ColorLightGreen
	ColorLightYellow
	ColorLightBlue
	ColorLightMagenta
	ColorLightCyan
	ColorLightGray
)

Colors first. The order here is significant.

type Event

type Event struct {
	Type EventType
	Key  Key
	Ch   rune
}

Event represents an event like a key press, mouse action, or window resize.

func PollEvent

func PollEvent() Event

PollEvent blocks until an event is ready, and then returns it.

type EventType

type EventType uint8

EventType represents the type of event.

const (
	EventNone EventType = iota
	EventKey
)

Event types.

type Key

type Key int16

Key is a key press.

type Modifier

type Modifier int16

Modifier represents the possible modifier keys.

type Provider

type Provider int
const (
	TermBox Provider = iota
	TCell
)

func (Provider) String

func (p Provider) String() string

Jump to

Keyboard shortcuts

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