1
0
Fork 0

Add arrow key escape sequences

This commit is contained in:
Timothy Warren 2021-03-25 13:19:22 -04:00
parent ebf6b38a97
commit fdb34d8533
1 changed files with 5 additions and 0 deletions

View File

@ -10,6 +10,11 @@ const HideCursor = "\x1b[?25l"
const ShowCursor = "\x1b[?25h"
const ResetCursor = "\x1b[H"
const KeyArrowUp = "\x1b[A"
const KeyArrowDown = "\x1b[B"
const KeyArrowRight = "\x1b[C"
const KeyArrowLeft = "\x1b[D"
func Code (s string) string {
return fmt.Sprintf("\x1b[%s", s)
}