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:
Elias Naur
2023-11-15 19:14:14 -06:00
parent 651094d692
commit 9dfada745c
8 changed files with 390 additions and 230 deletions
+1
View File
@@ -1037,6 +1037,7 @@ func TestPassCursor(t *testing.T) {
Position: f32.Pt(10, 10),
Kind: pointer.Move,
})
r.Frame(&ops)
if got := r.Cursor(); want != got {
t.Errorf("got cursor %v, want %v", got, want)
}