feat: obliterate type KeySpace

Treating a space differently from other runes was proving to cause more
confusion that clarity.
This commit is contained in:
Christian Rocha 2022-05-10 16:27:29 -04:00
parent 48cdc1e6c3
commit d3fb1b707a
1 changed files with 0 additions and 10 deletions

10
key.go
View File

@ -198,7 +198,6 @@ const (
KeyPgUp
KeyPgDown
KeyDelete
KeySpace
KeyCtrlUp
KeyCtrlDown
KeyCtrlRight
@ -275,7 +274,6 @@ var keyNames = map[KeyType]string{
KeyUp: "up",
KeyDown: "down",
KeyRight: "right",
KeySpace: " ", // for backwards compatibility
KeyLeft: "left",
KeyShiftTab: "shift+tab",
KeyHome: "home",
@ -554,14 +552,6 @@ func readInputs(input io.Reader) ([]Msg, error) {
}, nil
}
// If it's a space, override the type with KeySpace (but still include the
// rune).
if runes[0] == ' ' {
return []Msg{
KeyMsg(Key{Type: KeySpace, Runes: runes}),
}, nil
}
// Welp, it's just a regular, ol' single rune.
return []Msg{
KeyMsg(Key{Type: KeyRunes, Runes: runes}),