Skip to content

Commit

Permalink
always emit deltaX and deltaY for Input.dispatchMouseEvent
Browse files Browse the repository at this point in the history
Otherwise, the CDP message with the following params:
 {"type":"mouseWheel","x":0,"y":0,"modifiers":0,"deltaY":100}
will result in an error:
 {"code":-32602,"message":"'deltaX' and 'deltaY' are expected for mouseWheel event"}

Fixes #10
  • Loading branch information
ZekeLu committed May 18, 2021
1 parent abc6091 commit 7c9d7a0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions fixup/fixup.go
Expand Up @@ -177,6 +177,13 @@ const ModifierCommand Modifier = ModifierMeta
p.AlwaysEmit = true
}
}
case "dispatchMouseEvent":
for _, p := range c.Parameters {
switch p.Name {
case "deltaX", "deltaY":
p.AlwaysEmit = true
}
}
}
}

Expand Down

0 comments on commit 7c9d7a0

Please sign in to comment.