keyboard

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2024 License: Apache-2.0 Imports: 0 Imported by: 40

Documentation

Overview

Package keyboard defines well known keyboard keys and shortcuts.

Index

Constants

View Source
const (
	KeySpace = ' '
)

Printable characters, but worth having constants for them.

Variables

This section is empty.

Functions

This section is empty.

Types

type Key

type Key rune

Key represents a single button on the keyboard. Printable characters are set to their ASCII/Unicode rune value. Non-printable (control) characters are equal to one of the constants defined below.

const (
	KeyF1 Key = -(iota + 1)
	KeyF2
	KeyF3
	KeyF4
	KeyF5
	KeyF6
	KeyF7
	KeyF8
	KeyF9
	KeyF10
	KeyF11
	KeyF12
	KeyInsert
	KeyDelete
	KeyHome
	KeyEnd
	KeyPgUp
	KeyPgDn
	KeyArrowUp
	KeyArrowDown
	KeyArrowLeft
	KeyArrowRight
	KeyCtrlTilde
	KeyCtrlA
	KeyCtrlB
	KeyCtrlC
	KeyCtrlD
	KeyCtrlE
	KeyCtrlF
	KeyCtrlG
	KeyBackspace
	KeyTab
	KeyBacktab
	KeyCtrlJ
	KeyCtrlK
	KeyCtrlL
	KeyEnter
	KeyCtrlN
	KeyCtrlO
	KeyCtrlP
	KeyCtrlQ
	KeyCtrlR
	KeyCtrlS
	KeyCtrlT
	KeyCtrlU
	KeyCtrlV
	KeyCtrlW
	KeyCtrlX
	KeyCtrlY
	KeyCtrlZ
	KeyEsc
	KeyCtrl4
	KeyCtrl5
	KeyCtrl6
	KeyCtrl7
	KeyBackspace2
)

Negative values for non-printable characters.

const (
	KeyCtrl2          Key = KeyCtrlTilde
	KeyCtrlSpace      Key = KeyCtrlTilde
	KeyCtrlH          Key = KeyBackspace
	KeyCtrlI          Key = KeyTab
	KeyCtrlM          Key = KeyEnter
	KeyCtrlLsqBracket Key = KeyEsc
	KeyCtrl3          Key = KeyEsc
	KeyCtrlBackslash  Key = KeyCtrl4
	KeyCtrlRsqBracket Key = KeyCtrl5
	KeyCtrlSlash      Key = KeyCtrl7
	KeyCtrlUnderscore Key = KeyCtrl7
	KeyCtrl8          Key = KeyBackspace2
)

Keys declared as duplicates by termbox.

func (Key) String

func (b Key) String() string

String implements fmt.Stringer()

Jump to

Keyboard shortcuts

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