Fix incorrect line feed value + also listen for tab

This commit is contained in:
Christian Rocha 2020-01-18 11:20:26 -05:00
parent 768462afb3
commit fac654d7ef
No known key found for this signature in database
GPG Key ID: D6CC7A16E5878018
1 changed files with 4 additions and 1 deletions

5
key.go
View File

@ -38,6 +38,7 @@ type KeyType int
// Possible keys
const (
KeyBreak KeyType = iota
KeyTab
KeyEnter
KeyEscape
KeyUp
@ -52,6 +53,7 @@ const (
// Friendly key names
var keyNames = map[KeyType]string{
KeyBreak: "break",
KeyTab: "tab",
KeyEnter: "enter",
KeyEscape: "esc",
KeyUp: "up",
@ -67,7 +69,8 @@ var keyNames = map[KeyType]string{
// specific, so we set the values explicitly to avoid any confusion
const (
keyETX = 3 // break, ctrl+c
keyLF = 9 // line-feed, \n
keyHT = 9 // horizontal tabulation, \t
keyLF = 10 // line feed, \n
keyCR = 13 // carriage return, \r
keyESC = 27 // escape
keyUS = 31 // unit separator