input

package
v0.0.0-...-eb689ba Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2024 License: GPL-2.0 Imports: 11 Imported by: 2

Documentation

Overview

Package input provides raw input handling.

Index

Constants

View Source
const (
	EscChar = 27

	CtrlC     = "\x03"
	CtrlH     = "\x08"
	Return    = "\x0a"
	CtrlL     = "\x0c"
	Enter     = "\x0d"
	CtrlN     = "\x0e"
	CtrlP     = "\x10"
	CtrlR     = "\x12"
	CtrlS     = "\x13"
	CtrlU     = "\x15"
	CtrlV     = "\x16"
	Esc       = "\x1b"
	Backspace = "\x7F"

	Up     = "\x1B[A"
	Down   = "\x1B[B"
	Right  = "\x1B[C"
	Left   = "\x1B[D"
	F1     = "\x1BOP"
	F2     = "\x1BOQ"
	F3     = "\x1BOR"
	F4     = "\x1BOS"
	Home   = "\x1B[1~"
	End    = "\x1B[4~"
	PgUp   = "\x1B[5~"
	PgDown = "\x1B[6~"
	XEnd   = "\x1B[E"
	XHome  = "\x1B[H"
)

Named keys

Variables

This section is empty.

Functions

This section is empty.

Types

type Input

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

Input is an input handler. Singleton, really.

func New

func New() *Input

New creates a new input handler.

func (*Input) Chan

func (i *Input) Chan() <-chan string

Chan returns the input stream channel.

func (*Input) PastePop

func (i *Input) PastePop()

PastePop pops the status.

func (*Input) PastePush

func (i *Input) PastePush(b bool)

PastePush triggers/untriggers paste protection in the stack.

func (*Input) Start

func (i *Input) Start() error

Start turns on raw mode and the key-receive loop.

func (*Input) Stop

func (i *Input) Stop()

Stop input loop, turn off raw mode.

func (*Input) Winch

func (i *Input) Winch() <-chan os.Signal

Winch returns a SIGWINCH channel.

Jump to

Keyboard shortcuts

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