gesture: report one event at a time

Events are now delivered one at a time, and this change makes the
corresponding change to gestures.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2023-11-25 16:38:48 -06:00
parent ab9f42c820
commit 8e209fd2eb
9 changed files with 82 additions and 36 deletions
+5 -1
View File
@@ -47,7 +47,11 @@ func (e *Enum) Update(gtx layout.Context) bool {
e.hovering = false
changed := false
for _, state := range e.keys {
for _, ev := range state.click.Update(gtx.Source) {
for {
ev, ok := state.click.Update(gtx.Source)
if !ok {
break
}
switch ev.Kind {
case gesture.KindPress:
if ev.Source == pointer.Mouse {