From 073bc24a9a4db702ca66192dff6c5891a138e5e7 Mon Sep 17 00:00:00 2001 From: Zeke Lu Date: Tue, 18 May 2021 12:43:28 +0800 Subject: [PATCH] always emit deltaX and deltaY for Input.dispatchMouseEvent 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 --- fixup/fixup.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/fixup/fixup.go b/fixup/fixup.go index be64731..514e6d9 100644 --- a/fixup/fixup.go +++ b/fixup/fixup.go @@ -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 + } + } } }