Type Key

type Key uint16

Key is one normalized, platform-independent keyboard identity.

Constants

const (
	KeyUnknown Key = iota
	KeyTab
	KeyEnter
	KeySpace
	KeyEscape
	KeyLeft
	KeyRight
	KeyUp
	KeyDown
	KeyHome
	KeyEnd
	KeyBackspace
	KeyDelete
	KeyPageUp
	KeyPageDown
	KeyInsert
	KeyF1
	KeyF2
	KeyF3
	KeyF4
	KeyF5
	KeyF6
	KeyF7
	KeyF8
	KeyF9
	KeyF10
	KeyF11
	KeyF12
	// The modifier keys themselves. They are delivered only to a terminal that
	// asked for key releases (see app.TextInput.KeyReleases), as a press when
	// the key goes down and a release when it comes up; KeyEvent.Modifiers
	// then holds the modifiers in effect after the change.
	KeyShiftLeft
	KeyShiftRight
	KeyControlLeft
	KeyControlRight
	KeyAltLeft
	KeyAltRight
	KeyMetaLeft
	KeyMetaRight
)

Methods

IsModifier#

func (key Key) IsModifier() bool

IsModifier reports whether the key is one of the modifier keys.

Modifier#

func (key Key) Modifier() Modifiers

Modifier is the modifier bit the key sets while held, zero for other keys.