From fac654d7ef46a1050feef79d5f66dc2bfdcb67e7 Mon Sep 17 00:00:00 2001 From: Christian Rocha Date: Sat, 18 Jan 2020 11:20:26 -0500 Subject: [PATCH] Fix incorrect line feed value + also listen for tab --- key.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/key.go b/key.go index 8360e7c..07938e9 100644 --- a/key.go +++ b/key.go @@ -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