io,app: route all unhandled key events to the topmost handler

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2023-02-06 17:10:21 -06:00
parent 32c6a9b10d
commit 0dba85f52e
3 changed files with 27 additions and 1 deletions
+5
View File
@@ -937,6 +937,11 @@ func (w *Window) processEvent(d driver, e event.Event) bool {
handled = false
}
}
// As a sepcial case, the top-most input handler receives all unhandled
// events.
if e, ok := e.(key.Event); ok && !handled {
handled = w.queue.q.QueueTopmost(e)
}
w.updateCursor(d)
return handled
}