mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-08 02:45:38 +00:00
ui: add package input for merged input
To avoid passing a queue type for each kind of input (pointer, key), introduce package input for mapping a handler key to all input events. Future input sources can be added without changes to programs, and as an added bonus, event ordering is preserved across input sources. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+2
-1
@@ -8,6 +8,7 @@ import (
|
||||
"gioui.org/ui"
|
||||
"gioui.org/ui/draw"
|
||||
"gioui.org/ui/gesture"
|
||||
"gioui.org/ui/input"
|
||||
"gioui.org/ui/pointer"
|
||||
)
|
||||
|
||||
@@ -64,7 +65,7 @@ func (l *List) Dragging() bool {
|
||||
return l.scroll.Dragging()
|
||||
}
|
||||
|
||||
func (l *List) Update(c *ui.Config, q pointer.Events) {
|
||||
func (l *List) Update(c *ui.Config, q input.Events) {
|
||||
l.Distance = 0
|
||||
d := l.scroll.Update(c, q, gesture.Axis(l.Axis))
|
||||
l.scrollDir = d
|
||||
|
||||
Reference in New Issue
Block a user