diff --git a/inputfield.go b/inputfield.go index 3205d72..c6b1a17 100644 --- a/inputfield.go +++ b/inputfield.go @@ -374,12 +374,7 @@ func (i *InputField) InputHandler() func(event *tcell.EventKey, setFocus func(p // Process key event. switch key := event.Key(); key { case tcell.KeyRune: // Regular character. - modifiers := event.Modifiers() - if modifiers == tcell.ModNone { - if !add(event.Rune()) { - break - } - } else if modifiers&tcell.ModAlt > 0 { + if event.Modifiers()&tcell.ModAlt > 0 { // We accept some Alt- key combinations. switch event.Rune() { case 'a': // Home. @@ -390,10 +385,11 @@ func (i *InputField) InputHandler() func(event *tcell.EventKey, setFocus func(p moveWordLeft() case 'f': // Move word right. moveWordRight() - default: // Ignore Alt modifier for other keys. - if !add(event.Rune()) { - break - } + } + } else { + // Other keys are simply accepted as regular characters. + if !add(event.Rune()) { + break } } case tcell.KeyCtrlU: // Delete all.