cannot match tea.KeySpace
#288
-
I think (correct me if I'm wrong) it is not possible to match any event to |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 3 replies
-
Hi! You actually just match on a literal space: // It's usually simplest to just use the Stringer interface
switch msg.String() {
case " ":
// It's a space!
}
// The super verbose way
if msg.Type == tea.KeyRunes && string(msg.Runes) == " " {
// It's a space!
} |
Beta Was this translation helpful? Give feedback.
-
Thanks, I figured that part by myself! ;) What I meant is, pressing [space] in bubbletea will produce a In my first program I wanted [space] to trigger a special behaviour, so naturally I went for something like this:
... and it took me some time to realize that this won't match the space key. |
Beta Was this translation helpful? Give feedback.
-
Hey, just an update that these changes were merged to |
Beta Was this translation helpful? Give feedback.
-
Hi @tgirod we got rid of |
Beta Was this translation helpful? Give feedback.
Hi! You actually just match on a literal space: