Skip to content
Myr

Fix incorrect line feed value + also listen for tab

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 768462a · Browse files · 1 file+4 added−1 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+4 added−1 removed

  • other:+4 added−1 removed

1 file+4 added−1 removed

modified:key.go+4 added-1 removed
36 unmodified lines
3738// Possible keys39const (40 KeyBreak KeyType = iota41 KeyTab42 KeyEnter43 KeyEscape44 KeyUp45 KeyDown
6 unmodified lines
5253// Friendly key names54var keyNames = map[KeyType]string{55 KeyBreak: "break",56 KeyTab: "tab",57 KeyEnter: "enter",58 KeyEscape: "esc",59 KeyUp: "up",60 KeyDown: "down",
7 unmodified lines
68// Control keys. I know we could do this with an iota, but the values are very69// specific, so we set the values explicitly to avoid any confusion70const (71 keyETX = 3 // break, ctrl+c72 keyHT = 9 // horizontal tabulation, \t70 keyLF = 9 // line-feed, \n73 keyLF = 10 // line feed, \n74 keyCR = 13 // carriage return, \r75 keyESC = 27 // escape76 keyUS = 31 // unit separator77 keyDEL = 127 // delete. on most systems this is mapped to backspace, I hear
58 unmodified lines