MicrosoftEdge / MicrosoftEdge/WebView2Feedback

Send Touchpad Scrolling Input for CoreWebView2CompositionController

Open
#3,435 7 comments 9 reactions 2 assignees View on GitHub

@Lakshmisha-KS is already working on this.

Since Feb 12, 2025.

feature request tracked
Dominant language
PowerShell
Stars
526
Forks
67
PR merge metrics
No merged PRs in 30d

Description

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 #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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.