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.
()
| 349 | // For example, you'll always get "?" and instead of "shift+/" on a US ANSI |
| 350 | // keyboard. |
| 351 | func (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 |