Documentation
¶
Index ¶
- func CanonicalID(key tcell.Key, r rune, mod tcell.ModMask) string
- func IsReserved(key tcell.Key, r rune, mod tcell.ModMask) bool
- func NormalizeEvent(ev *tcell.EventKey) (tcell.Key, rune, tcell.ModMask)
- func NormalizeNavigationEvent(ev *tcell.EventKey) *tcell.EventKey
- func Parse(spec string) (tcell.Key, rune, tcell.ModMask, error)
- func ToChar(k tcell.Key) (rune, bool)
- func Validate(spec string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CanonicalID ¶
CanonicalID returns a unique identifier for a parsed key combination.
func IsReserved ¶
IsReserved reports whether the given key combination is reserved for navigation and should not be reassigned. Only unmodified keys are checked.
func NormalizeEvent ¶
NormalizeEvent converts an EventKey into a canonical (key,rune,mod) triple. Ctrl+A style events are normalized to KeyRune with the corresponding rune.
func NormalizeNavigationEvent ¶ added in v1.0.15
NormalizeNavigationEvent normalizes terminal key events for in-app navigation.
In particular, many UIs (including tview forms/buttons) expect Shift+Tab to be represented as KeyBacktab. Some terminals/tcell versions instead emit KeyTab with ModShift. This helper converts the latter to KeyBacktab so widgets can reliably navigate backwards.
func Parse ¶
Parse converts a key specification like "Ctrl+A" or "F5" to tcell values. It returns the key, optional rune, and modifier mask.
Types ¶
This section is empty.