MCPcopy Create free account
hub / github.com/charmbracelet/bubbletea / String

Method String

key.go:351–353  ·  view source on GitHub ↗

String implements [fmt.Stringer] and is quite useful for matching key events. It will return the textual representation of the [Key] if there is one, otherwise, it will fallback to [Key.Keystroke]. For example, you'll always get "?" and instead of "shift+/" on a US ANSI keyboard.

()

Source from the content-addressed store, hash-verified

349// For example, you'll always get "?" and instead of "shift+/" on a US ANSI
350// keyboard.
351func (k Key) String() string {
352 return uv.Key(k).String()
353}
354
355// Keystroke returns the keystroke representation of the [Key]. While less type
356// safe than looking at the individual fields, it will usually be more

Calls 1

KeyMethod · 0.65