From 32dc19b3d3726ad611e6ce27362c46cdabf7ee21 Mon Sep 17 00:00:00 2001 From: Christian Rocha Date: Fri, 17 Jan 2020 22:21:17 -0500 Subject: [PATCH] Fix a bug where control keys weren't being properly mapped --- key.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/key.go b/key.go index fa231ac..8360e7c 100644 --- a/key.go +++ b/key.go @@ -46,7 +46,7 @@ const ( KeyLeft KeyUnitSeparator KeyBackspace - KeyRune + KeyRune = -1 ) // Friendly key names @@ -111,7 +111,7 @@ func ReadKey(r io.Reader) (Key, error) { // Is it a control character? if n == 1 && c <= keyUS || c == keyDEL { - if k, ok := controlKeys[n]; ok { + if k, ok := controlKeys[int(c)]; ok { return Key{Type: k}, nil } }