mirror of
https://github.com/mum4k/termdash.git
synced 2025-04-25 13:48:50 +08:00
Return nil for non-termdash events
This commit is contained in:
parent
f7578e54cc
commit
1e970dcacd
@ -186,9 +186,7 @@ func toTermdashEvents(event tcell.Event) []terminalapi.Event {
|
||||
if termdashOk {
|
||||
return []terminalapi.Event{mouseEvent}
|
||||
} else {
|
||||
return []terminalapi.Event{
|
||||
terminalapi.NewErrorf("unknown tcell event type: %v", event),
|
||||
}
|
||||
return nil
|
||||
}
|
||||
case *tcell.EventResize:
|
||||
return []terminalapi.Event{convResize(event)}
|
||||
|
@ -177,7 +177,9 @@ func (t *Terminal) pollEvents() {
|
||||
|
||||
events := toTermdashEvents(t.screen.PollEvent())
|
||||
for _, ev := range events {
|
||||
t.events.Push(ev)
|
||||
if ev != nil {
|
||||
t.events.Push(ev)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user