From d3fb1b707a27c6df66cb97647a902c2f110eee39 Mon Sep 17 00:00:00 2001 From: Christian Rocha Date: Tue, 10 May 2022 16:27:29 -0400 Subject: [PATCH] feat: obliterate type KeySpace Treating a space differently from other runes was proving to cause more confusion that clarity. --- key.go | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/key.go b/key.go index e2415a9..7f05b87 100644 --- a/key.go +++ b/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}),