mirror of https://github.com/rivo/tview.git
parent
1dd674a1b9
commit
61a4cf388a
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue