forked from Mirrors/bubbletea
Fix incorrect line feed value + also listen for tab
This commit is contained in:
parent
768462afb3
commit
fac654d7ef
5
key.go
5
key.go
|
@ -38,6 +38,7 @@ type KeyType int
|
||||||
// Possible keys
|
// Possible keys
|
||||||
const (
|
const (
|
||||||
KeyBreak KeyType = iota
|
KeyBreak KeyType = iota
|
||||||
|
KeyTab
|
||||||
KeyEnter
|
KeyEnter
|
||||||
KeyEscape
|
KeyEscape
|
||||||
KeyUp
|
KeyUp
|
||||||
|
@ -52,6 +53,7 @@ const (
|
||||||
// Friendly key names
|
// Friendly key names
|
||||||
var keyNames = map[KeyType]string{
|
var keyNames = map[KeyType]string{
|
||||||
KeyBreak: "break",
|
KeyBreak: "break",
|
||||||
|
KeyTab: "tab",
|
||||||
KeyEnter: "enter",
|
KeyEnter: "enter",
|
||||||
KeyEscape: "esc",
|
KeyEscape: "esc",
|
||||||
KeyUp: "up",
|
KeyUp: "up",
|
||||||
|
@ -67,7 +69,8 @@ var keyNames = map[KeyType]string{
|
||||||
// specific, so we set the values explicitly to avoid any confusion
|
// specific, so we set the values explicitly to avoid any confusion
|
||||||
const (
|
const (
|
||||||
keyETX = 3 // break, ctrl+c
|
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
|
keyCR = 13 // carriage return, \r
|
||||||
keyESC = 27 // escape
|
keyESC = 27 // escape
|
||||||
keyUS = 31 // unit separator
|
keyUS = 31 // unit separator
|
||||||
|
|
Loading…
Reference in New Issue