forked from Mirrors/bubbletea
feat: obliterate type KeySpace
Treating a space differently from other runes was proving to cause more confusion that clarity.
This commit is contained in:
parent
48cdc1e6c3
commit
d3fb1b707a
10
key.go
10
key.go
|
@ -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}),
|
||||
|
|
Loading…
Reference in New Issue