From 8a9e26fab0ff612fe18f63a8fa79e9999a20c18d Mon Sep 17 00:00:00 2001 From: Oliver Date: Sun, 24 Mar 2019 19:21:52 +0100 Subject: [PATCH] Hitting the Alt-key should not prevent input. Fixes #240 --- README.md | 2 +- inputfield.go | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5a182b6..0c8f6d2 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ Refer to https://godoc.org/github.com/rivo/tview for the package's documentation ## Dependencies -This package is based on [github.com/gdamore/tcell](https://github.com/gdamore/tcell) (and its dependencies). +This package is based on [github.com/gdamore/tcell](https://github.com/gdamore/tcell) (and its dependencies) as well as on [github.com/rivo/uniseg](https://github.com/rivo/uniseg). ## Your Feedback diff --git a/inputfield.go b/inputfield.go index f1d87a3..897df2e 100644 --- a/inputfield.go +++ b/inputfield.go @@ -384,11 +384,15 @@ func (i *InputField) InputHandler() func(event *tcell.EventKey, setFocus func(p moveWordLeft() case 'f': // Move word right. moveWordRight() + default: + if !add(event.Rune()) { + return + } } } else { // Other keys are simply accepted as regular characters. if !add(event.Rune()) { - break + return } } case tcell.KeyCtrlU: // Delete all.