From 04e5e8c5bc04333254b83b614517cdbcfe941f30 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Wed, 23 Mar 2016 10:49:51 -0700 Subject: [PATCH] fixes #85 Key press not registered (only key release) for some keys --- tscreen.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tscreen.go b/tscreen.go index fd11d99..f03e714 100644 --- a/tscreen.go +++ b/tscreen.go @@ -248,6 +248,18 @@ func (t *tScreen) prepareKeys() { t.prepareKey(KeyCancel, ti.KeyCancel) t.prepareKey(KeyExit, ti.KeyExit) t.prepareKey(KeyBacktab, ti.KeyBacktab) + +outer: + for i := 0; i < ' '; i++ { + for _, esc := range t.keys { + if esc[0] == byte(i) { + continue outer + } + } + b := make([]byte, 1) + b[0] = byte(i) + t.keys[Key(i)] = b + } } func (t *tScreen) Fini() {