keys

package
v1.0.11 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CanonicalID

func CanonicalID(key tcell.Key, r rune, mod tcell.ModMask) string

CanonicalID returns a unique identifier for a parsed key combination.

func IsReserved

func IsReserved(key tcell.Key, r rune, mod tcell.ModMask) bool

IsReserved reports whether the given key combination is reserved for navigation and should not be reassigned. Only unmodified keys are checked.

func NormalizeEvent

func NormalizeEvent(ev *tcell.EventKey) (tcell.Key, rune, tcell.ModMask)

NormalizeEvent converts an EventKey into a canonical (key,rune,mod) triple. Ctrl+A style events are normalized to KeyRune with the corresponding rune.

func Parse

func Parse(spec string) (tcell.Key, rune, tcell.ModMask, error)

Parse converts a key specification like "Ctrl+A" or "F5" to tcell values. It returns the key, optional rune, and modifier mask.

func ToChar

func ToChar(k tcell.Key) (rune, bool)

ToChar converts a tcell.Key to its rune representation if it's a Ctrl+<char> key.

func Validate

func Validate(spec string) error

Validate returns an error if the key specification is not recognized.

Types

This section is empty.

Jump to

Keyboard shortcuts

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