You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// It's usually simplest to just use the Stringer interfaceswitchmsg.String() {
case" ":
// It's a space!
}
// The super verbose wayifmsg.Type==tea.KeyRunes&&string(msg.Runes) ==" " {
// It's a space!
}
What I meant is, pressing [space] in bubbletea will produce a Key{Type: KeyRunes} event, but no keystroke will ever produce a Key{Type: KeySpace}, and I find it misleading.
In my first program I wanted [space] to trigger a special behaviour, so naturally I went for something like this:
switch msg.Type {
case tea.KeySpace:
// triggers something special
case tea.KeyRunes:
// append to the model's state
}
... and it took me some time to realize that this won't match the space key.
I think (correct me if I'm wrong) it is not possible to match any event to
tea.KeySpace
.The text was updated successfully, but these errors were encountered: