mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-05 17:35:36 +00:00
io/input: implement lazy event routing
This change defers event routing from the time the event is queued until the time Events is called. This allows a future change to execute commands immediately and to react to event order changes during a frame. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -464,14 +464,14 @@ func assertKeyEventUnexpected(t *testing.T, events []event.Event) {
|
||||
|
||||
func assertFocus(t *testing.T, router *Router, expected event.Tag) {
|
||||
t.Helper()
|
||||
if got := router.key.queue.focus; got != expected {
|
||||
if got := router.lastState().focus; got != expected {
|
||||
t.Errorf("expected %v to be focused, got %v", expected, got)
|
||||
}
|
||||
}
|
||||
|
||||
func assertKeyboard(t *testing.T, router *Router, expected TextInputState) {
|
||||
t.Helper()
|
||||
if got := router.key.queue.state; got != expected {
|
||||
if got := router.lastState().state; got != expected {
|
||||
t.Errorf("expected %v keyboard, got %v", expected, got)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user