rawterm

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2024 License: UNKNOWN not legal advice Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CRLF = []byte{'\r', '\n'}

Functions

This section is empty.

Types

type KeyPress

type KeyPress byte
const (
	KeyNone  KeyPress = 0      // None
	KeyCtrlC KeyPress = '\x03' // Ctrl+C
	KeyCtrlD KeyPress = '\x04' // Ctrl+D
	KeyCtrlE KeyPress = '\x05' // Ctrl+E
	KeyCtrlL KeyPress = '\x0c' // Ctrl+L
	KeyCtrlO KeyPress = '\x0f' // Ctrl+O
	KeyCtrlR KeyPress = '\x12' // Ctrl+R
	KeyCtrlS KeyPress = '\x13' // Ctrl+S
	KeyCtrlT KeyPress = '\x14' // Ctrl+T

	KeyA KeyPress = 'A'
	KeyE KeyPress = 'E'
	KeyH KeyPress = 'H'
	KeyI KeyPress = 'I'
	KeyN KeyPress = 'N'
	KeyP KeyPress = 'P'
	KeyR KeyPress = 'R'
)

key representation

func (KeyPress) String

func (k KeyPress) String() string

func (KeyPress) Upper

func (k KeyPress) Upper() KeyPress

type RawTerm

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

rawTerminal wraps an io.Writer, converting \n to \r\n

func NewRawTerm

func NewRawTerm() *RawTerm

func (*RawTerm) Init

func (rt *RawTerm) Init() (restore func() error, err error)

func (*RawTerm) ReadKeyPress

func (rt *RawTerm) ReadKeyPress() (KeyPress, error)

func (*RawTerm) Write

func (rt *RawTerm) Write(buf []byte) (n int, err error)

Jump to

Keyboard shortcuts

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