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:
Gordon Klaus
2020-06-03 15:22:48 +02:00
committed by Elias Naur
parent 4484674ab1
commit 9d2a6c48d8
7 changed files with 102 additions and 19 deletions
+4 -1
View File
@@ -56,6 +56,8 @@ type InputOp struct {
// Grab, if set, request that the handler get
// Grabbed priority.
Grab bool
// Types is a bitwise-or of event types to receive.
Types Type
}
// PassOp sets the pass-through mode.
@@ -83,7 +85,7 @@ type areaKind uint8
const (
// A Cancel event is generated when the current gesture is
// interrupted by other handlers or the system.
Cancel Type = iota
Cancel Type = (1 << iota) >> 1
// Press of a pointer.
Press
// Release of a pointer.
@@ -157,6 +159,7 @@ func (h InputOp) Add(o *op.Ops) {
if h.Grab {
data[1] = 1
}
data[2] = byte(h.Types)
}
func (op PassOp) Add(o *op.Ops) {