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 KeyPgUp
KeyPgDown KeyPgDown
KeyDelete KeyDelete
KeySpace
KeyCtrlUp KeyCtrlUp
KeyCtrlDown KeyCtrlDown
KeyCtrlRight KeyCtrlRight
@ -275,7 +274,6 @@ var keyNames = map[KeyType]string{
KeyUp: "up", KeyUp: "up",
KeyDown: "down", KeyDown: "down",
KeyRight: "right", KeyRight: "right",
KeySpace: " ", // for backwards compatibility
KeyLeft: "left", KeyLeft: "left",
KeyShiftTab: "shift+tab", KeyShiftTab: "shift+tab",
KeyHome: "home", KeyHome: "home",
@ -554,14 +552,6 @@ func readInputs(input io.Reader) ([]Msg, error) {
}, nil }, 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. // Welp, it's just a regular, ol' single rune.
return []Msg{ return []Msg{
KeyMsg(Key{Type: KeyRunes, Runes: runes}), KeyMsg(Key{Type: KeyRunes, Runes: runes}),