Skip to content
Myr

Treat space key as a control character (instead of a " ")

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Christian Rocha · committed by Christian Rocha · parent 88e4df4 · Browse files · 1 file+6 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+6 added−0 removed

  • other:+6 added−0 removed

1 file+6 added−0 removed

modified:key.go+6 added
254 unmodified lines
255 if numBytes == 1 && char <= keyUS || char == keyDEL {256 return Key{Type: KeyType(char)}, nil257 }258259 // If it's a space treat it like a control character (otherwise it gets260 // treated as the character " "261 if string(char) == " " {262 return Key{Type: KeyType(keySP)}, nil263 }264265 // Is it a special sequence, like an arrow key?266 if k, ok := sequences[string(buf[:numBytes])]; ok {267 return Key{Type: k}, nil268 }
16 unmodified lines