Skip to content

Commit

Permalink
feat: obliterate type KeySpace
Browse files Browse the repository at this point in the history
Treating a space differently from other runes was proving to cause more
confusion that clarity.
  • Loading branch information
meowgorithm committed May 10, 2022
1 parent 48cdc1e commit d3fb1b7
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions key.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@ const (
KeyPgUp
KeyPgDown
KeyDelete
KeySpace
KeyCtrlUp
KeyCtrlDown
KeyCtrlRight
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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}),
Expand Down

0 comments on commit d3fb1b7

Please sign in to comment.