Help us shape the future of Go! Take the 2026 Go Developer Survey

keys

package
v0.233.2 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AllKnownKeys = []string{}/* 126 elements not displayed */

AllKnownKeys is a comprehensive list of all known keyboard combinations

View Source
var InputHandlerKeys = []string{
	"space", "tab", "enter", "alt+enter", "shift+enter", "backspace", "delete",
	"up", "down", "left", "right", "home", "end",
	"ctrl+a", "ctrl+e", "ctrl+u", "ctrl+k", "ctrl+w", "ctrl+l",
	"ctrl+z", "ctrl+y",
	"super+v", "super+c",
}

InputHandlerKeys are keys that can be handled by text input components

Functions

func CanInputHandle

func CanInputHandle(key tea.KeyPressMsg) bool

CanInputHandle checks if a key can be handled by input components

func IsKnownKey

func IsKnownKey(keyStr string) bool

IsKnownKey checks if a key string represents a known keyboard key combination or a single printable character

func IsPrintableCharacter

func IsPrintableCharacter(keyStr string) bool

IsPrintableCharacter checks if a key string represents a single printable character

func PrintableText

func PrintableText(key tea.KeyPressMsg) string

PrintableText returns the literal characters represented by a key press, or "" if the key has no printable text (Enter, Backspace, arrow keys, modifier combos, etc.). The printable text lives in KeyPressMsg.Text; String() returns the human-readable key *name* ("space", "ctrl+c"), which is what keybinding lookups want but is not what should be inserted into a text buffer. Use this helper when you need the literal input.

Types

This section is empty.

Jump to

Keyboard shortcuts

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