Skip to content

Send Touchpad Scrolling Input for CoreWebView2CompositionController #3435

Open
@GetGet99

Description

@GetGet99

Is your feature request related to a problem? Please describe.

Yes, this feature request relates to the problem that in the composition hosting environment, it is not possible to directly send a touchpad scrolling event in the CoreWebView2CompositionController. The touchpad event includes smooth scrolling in a way that it should be possible to send horizontal and vertical scrolling at the same time. Additionally, it is currently not possible to send a pinch to zoom command.

Describe the solution you'd like and alternatives you've considered

I would like an API to be able to send scroll event that is possible for both vertical and horizontal movement as well as the scaling factor at the same time.

Currently, I am aware of three alternatives but all of them have drawbacks.

  1. It is possible to just not handle anything and it will be sent as the regular mouse event. This approach is what is currently in use for microsoft-ui-xaml's WebView2 control. Providing that the horizontal scroll error is fixed, the drawbacks are that the scrolling is not smooth and it is not possible to make regular pinch to zoom (by "regular pinch to zoom" I mean the way of pinch to zoom is done on the regular Edge browser).
  2. It is also possible to use DevTools Protocol. This behavior is somewhat achievable by Input.dispatchMouseEvent and Emulation.setPageScaleFactor combined. However, when the page is zoomed in, the dispatch mouse event coordinates act like there is no zooming and panning on the page. Additionally, some websites do not work with this method (For example, vscode.dev) In addition to that, I have also seen another alternative to use Input.synthesizePinchGesture in Add zoom controls for pinch zoom (touchpad / touchscreen gesture) #485 . I did not fully test it yet but it has a delay and is not suitable for sending live touchpad pinch or scroll events. (Note: I got touchpad scroll/zoom in UWP using ElementInteractionTracker)
  3. The current workaround I am using is by handling touchpad scroll myself and using regular SendMouseInput similar to the first workaround. The downside is that I can only send either a horizontal scroll or a vertical scroll at a time, and it is not possible to do semantic zoom. (Note: I got touchpad scroll in UWP using ElementInteractionTracker)

AB#44331805

Metadata

Metadata

Labels

feature requestfeature requesttrackedWe are tracking this work internally.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions