codes

package
v0.0.0-...-772821d Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: GPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AsciiCtrlA = iota + 1
	AsciiCtrlB
	AsciiCtrlC
	AsciiEOF
	AsciiCtrlE
	AsciiCtrlF
	AsciiCtrlG
	IsoBackspace // ISO 646
	AsciiTab
	AsciiCtrlJ
	AsciiCtrlK
	AsciiCtrlL
	AsciiCtrlM
	AsciiCtrlN
	AsciiCtrlO
	AsciiCtrlP
	AsciiCtrlQ
	AsciiCtrlR
	AsciiCtrlS
	AsciiCtrlT
	AsciiCtrlU
	AsciiCtrlV
	AsciiCtrlW
	AsciiCtrlX
	AsciiCtrlY
	AsciiCtrlZ
	AsciiEscape
	AsciiCtrlSlash             // ^\
	AsciiCtrlCloseSquare       // ^]
	AsciiCtrlHat               // ^^
	AsciiCtrlUnderscore        // ^_
	AsciiBackspace       = 127 // ASCII 1963
)

ASCII character codes

Variables

View Source
var (
	Ss2 = []byte{esc, 'N'}
	Ss3 = []byte{esc, 'O'}
	Csi = []byte{esc, '['}
)

Functions

func GetAnsiEscSeq

func GetAnsiEscSeq(keySet types.KeyboardMode, keyPress KeyCode, modifier Modifier) []byte

TODO: As a special case, the SS3 sent before F1 through F4 is altered to CSI when sending a function key modifier as a parameter.

Types

type KeyCode

type KeyCode int
const (
	// 0 -> 255 is ascii
	AnsiUp KeyCode = 1000 + iota
	AnsiDown
	AnsiRight
	AnsiLeft
	AnsiInsert
	AnsiHome
	AnsiEnd
	AnsiDelete
	AnsiPageUp
	AnsiPageDown

	AnsiKeyPadSpace
	AnsiKeyPadTab
	AnsiKeyPadEnter
	AnsiKeyPadMultiply
	AnsiKeyPadAdd
	AnsiKeyPadComma
	AnsiKeyPadMinus
	AnsiKeyPadPeriod
	AnsiKeyPadDivide
	AnsiKeyPad0
	AnsiKeyPad1
	AnsiKeyPad2
	AnsiKeyPad3
	AnsiKeyPad4
	AnsiKeyPad5
	AnsiKeyPad6
	AnsiKeyPad7
	AnsiKeyPad8
	AnsiKeyPad9
	AnsiKeyPadEqual

	AnsiF1
	AnsiF2
	AnsiF3
	AnsiF4
	AnsiF5
	AnsiF6
	AnsiF7
	AnsiF8
	AnsiF9
	AnsiF10
	AnsiF11
	AnsiF12
	AnsiF13
	AnsiF14
	AnsiF15
	AnsiF16
	AnsiF17
	AnsiF18
	AnsiF19
	AnsiF20
)

type Modifier

type Modifier int
const (
	// Shift
	MOD_SHIFT Modifier = 1 << iota

	// Alt / Option
	MOD_ALT

	// Ctrl
	MOD_CTRL

	// Meta / Command
	MOD_META
)

func (Modifier) Is

func (mod Modifier) Is(flag Modifier) bool

Jump to

Keyboard shortcuts

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