forked from joejulian/gio
io/pointer: add InputOp.Types to specify which types of events to receive
Signed-off-by: Gordon Klaus <gordon.klaus@gmail.com>
This commit is contained in:
+9
-2
@@ -112,7 +112,10 @@ var touchSlop = unit.Dp(3)
|
||||
|
||||
// Add the handler to the operation list to receive click events.
|
||||
func (c *Click) Add(ops *op.Ops) {
|
||||
op := pointer.InputOp{Tag: c}
|
||||
op := pointer.InputOp{
|
||||
Tag: c,
|
||||
Types: pointer.Press | pointer.Release | pointer.Enter | pointer.Leave,
|
||||
}
|
||||
op.Add(ops)
|
||||
}
|
||||
|
||||
@@ -168,7 +171,11 @@ func (c *Click) Events(q event.Queue) []ClickEvent {
|
||||
|
||||
// Add the handler to the operation list to receive scroll events.
|
||||
func (s *Scroll) Add(ops *op.Ops) {
|
||||
oph := pointer.InputOp{Tag: s, Grab: s.grab}
|
||||
oph := pointer.InputOp{
|
||||
Tag: s,
|
||||
Grab: s.grab,
|
||||
Types: pointer.Press | pointer.Move | pointer.Release | pointer.Scroll,
|
||||
}
|
||||
oph.Add(ops)
|
||||
if s.flinger.Active() {
|
||||
op.InvalidateOp{}.Add(ops)
|
||||
|
||||
Reference in New Issue
Block a user