Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request - Add WPF TouchScroll/Multitouch Support #228

Closed
dinoc opened this issue Dec 18, 2013 · 40 comments
Closed

Feature Request - Add WPF TouchScroll/Multitouch Support #228

dinoc opened this issue Dec 18, 2013 · 40 comments

Comments

@dinoc
Copy link

dinoc commented Dec 18, 2013

I guess this is more of a feature request than an issue but it would be nice to have multitouch support:

-Scrolling with one finger
-Zooming with pinch zoom gesture

@cztomczak

This comment has been minimized.

@amaitland amaitland mentioned this issue Sep 14, 2014
@jornh jornh added the upstream These issues require fixing in the Chromium Embedded Framework(CEF) or Chromium. label Oct 22, 2014
@amaitland amaitland modified the milestone: 3000 Jan 9, 2015
@amaitland amaitland added the wpf label Jun 5, 2016
@amaitland
Copy link
Member

https://bitbucket.org/chromiumembedded/cef/issues/1059/cef3-multi-touch-support-with-offscreen

Until the upstream issue has been resolved it's not possible to implement MultiTouch in the WPF version. If you require it now then you will have to use the the WinForms version hosted in a WindowsFormsHost control.

Please no further comments asking when it will be ready, it's out of our control.

@amaitland amaitland changed the title Multitouch support WPF TouchScroll/Multitouch support Mar 23, 2017
@amaitland amaitland changed the title WPF TouchScroll/Multitouch support Feature Request - Add WPF TouchScroll/Multitouch Support Mar 23, 2017
@amaitland

This comment has been minimized.

@dhpanteon

This comment has been minimized.

@Clemani

This comment has been minimized.

@perlun

This comment has been minimized.

@Clemani

This comment has been minimized.

@equimal

This comment has been minimized.

@perlun

This comment has been minimized.

@equimal

This comment has been minimized.

@equimal

This comment has been minimized.

@equimal

This comment has been minimized.

@amaitland
Copy link
Member

https://bitbucket.org/chromiumembedded/cef/pull-requests/201/multi-touch-support-for-osr/diff

@Clemani
Copy link

Clemani commented May 28, 2019

I have tested on MS Surface Pro 4. I changed the CefSharp.Wpf.Example project to use ChromiumWebBrowserWithTouchSupport.
Touch scroll and zoom works fine so far. Maybe not 100% as smoothly as in WinForms... but good in my quick tests.

I encountered one issue:
Marking text with stylus does not work. When i move the pen down, press the right-click button and move the pen then no text gets selected. Sometimes one word gets selected but i cannot select a text area.

When i do this another issue happens:
o Enter www.google.com into the address box and press enter.
o Try to select a text with with pen and right click button
o Click into the address box with pen
Then a click with pen into the search box has no effect, the input focus remains in the address box.
When i click with my finger long time in the search box then the search box gets focused.

The input focus issue happens also in CefSharp.WinForms.Example. There i can reproduce it by:
o Enter www.google.com into the address box and press enter.
o Click with pen into the search box.
The search box seems to get focused, the cursor is blinking in the search box... but pressing keys has no effect.
This input focus issue happens also in CefGlue and cefclient.exe, so i guess it's a CEF or Chromium error.
My workaround for this is to watch for WM_PARENTNOTIFY: WM_LBUTTONDOWN, WM_MBUTTONDOWN, WM_RBUTTONDOWN, WM_XBUTTONDOWN, WM_POINTERDOWN and focus the CEF browser window when it's not focused.

@amaitland
Copy link
Member

Stylus/Pen support has been improved in #2817 the changes will be in version 75, it's still Experimental.

Anyone testing this out please report back here.

@mrBarrelNut

This comment has been minimized.

@mrBarrelNut

This comment has been minimized.

@andynugent

This comment has been minimized.

@amaitland
Copy link
Member

Unless there are any further reports of errors between now and the 77 release then the code from CefSharp.Wpf.Experimental.ChromiumWebBrowserWithTouchSupport will be merged into the default ChromiumWebBrowser class.

Anyone who has a few moments please test CefSharp.Wpf.Experimental.ChromiumWebBrowserWithTouchSupport and report back if you experience any problems.

@amaitland amaitland modified the milestones: 3000, 77.0.0 Sep 25, 2019
@cristiancarli

This comment has been minimized.

@Clemani
Copy link

Clemani commented Sep 27, 2019

Sorry amaitland - installing x86 version of Visual C++ runtime helped - i deleted the issue.
I changed namespace from CefSharp.Wpf.Experimental to CefSharp.Wpf in ChromiumWebBrowserWithTouchSupport.cs
Then i replaced ChromiumWebBrowser by ChromiumWebBrowserWithTouchSupport where i thought it makes sense (in XAML and on new statements) in CefSharp.Wpf.Example project.
On my Tablet i cannot scroll or zoom with my fingers. I think in my previous test i did the same and it worked. How can i make it working?

@amaitland
Copy link
Member

can you kindly explain us how to enable ChromiumWebBrowserWithTouchSupport ?

@cristiancarli Use ChromiumWebBrowserWithTouchSupport instead of ChromiumWebBrowser in your Xaml or .Net code.

On my Tablet i cannot scroll or zoom with my fingers. I think in my previous test i did the same and it worked. How can i make it working?

@Clemani If you are using a build of master (which I don't recommend for testing, use https://github.com/cefsharp/CefSharp.MinimalExample instead) then you will need to comment out

System.AppContext.SetSwitch("Switch.System.Windows.Input.Stylus.DisableStylusAndTouchSupport", true);

At line https://github.com/cefsharp/CefSharp/blob/master/CefSharp.Wpf.Example/App.xaml.cs#L16

There's a bug in WPF (dotnet/wpf#1323) that I've temp disabled DisableStylusAndTouchSupport to allow for testing of another feature/improvement.

@Clemani
Copy link

Clemani commented Sep 29, 2019

Thanks amaitland.
I tested today with master branch and CefSharp.Wpf.Example.
Touch scroll and zoom seems to work fine.
But with ChromiumWebBrowserWithTouchSupport selecting text with pen does not work anymore, and there is an issue with keyboard input. Please see my comment from May 28 which fully applies also to current master branch.
Not an issue, but i miss the "afterburner" effect when i scroll by finger. In the WinForms version when i move the finger and lift it off while i am moving the browser continues to scroll for a while - this does not happen in ChromiumWebBrowserWithTouchSupport.

@DelTaGC
Copy link

DelTaGC commented Sep 30, 2019

@amaitland Hi, will the multitouch feature of CefSharp.Wpf.Experimental.ChromiumWebBrowserWithTouchSupport also be available in 77 for CefSharp.OffScreen.ChromiumWebBrowser? For example by injecting fingers events like currently existing SendMouseClickEvent() and SendMouseWheelEvent()...

@amaitland
Copy link
Member

But with ChromiumWebBrowserWithTouchSupport selecting text with pen does not work anymore

@Clemani Thanks for the feedback, based on this I'll leave out the Pen/Stylus methods. I don't have a Pen/Stylus so I cannot test this currently so I was wondering if it might be best left as part of the Experimental implementation. Will merge basic touch support into ChromiumWebBrowser

there is an issue with keyboard input.

Can you please clarify which keyboard issue

Not an issue, but i miss the "afterburner" effect when i scroll by finger. In the WinForms version when i move the finger and lift it off while i am moving the browser continues to scroll for a while - this does not happen in ChromiumWebBrowserWithTouchSupport.

How does the CEF Sample application behave? You can download from http://opensource.spotify.com/cefbuilds/cef_binary_77.1.6%2Bga0ea7e6%2Bchromium-77.0.3865.90_windows32_client.tar.bz2

Please test with the following

cefclient --multi-threaded-message-loop --off-screen-rendering-enabled --enable-gpu

For example by injecting fingers events like currently existing SendMouseClickEvent() and SendMouseWheelEvent()...

@DelTaGC The SendTouchEvent method was added in version 73. Look at the ChromiumWebBrowserWithTouchSupport source if you need an example.

amaitland added a commit that referenced this issue Oct 3, 2019
- Touch support moved from ChromiumWebBrowserWithTouchSupport
- Stylus support was left in ChromiumWebBrowserWithTouchSupport as needs more testing

The CefSharp.Wpf.Example still has System.AppContext.SetSwitch("Switch.System.Windows.Input.Stylus.DisableStylusAndTouchSupport", true);
You will need to remove this for testing

Issue #228
@amaitland
Copy link
Member

amaitland commented Oct 3, 2019

Touch support has been moved from ChromiumWebBrowserWithTouchSupport to ChromiumWebBrowser in commit b31a365

Stylus/Pen support is still in ChromiumWebBrowserWithTouchSupport. I'll likely close this issue and create a new one to track adding Stylus/Pen support.

@Clemani
Copy link

Clemani commented Oct 3, 2019

Can you please clarify which keyboard issue

o For ex. enter www.google.com into the address box and press enter.
o Try to select a text on the web page with with pen and right click button
o Click into the address box with pen
o Then a click with pen into the search box on the web page has no effect, the input focus remains in the address box.
I cannot reproduce this reliable, sometimes the issue happens and sometimes not. When you have no pen then i think you cannot reproduce this issue.

Off-topic: The WinForms keyboard issue on touch devices is described here: https://bitbucket.org/chromiumembedded/cef/issues/1797/windows-touch-does-not-return-focus-to-the

How does the CEF Sample application behave? ...

How can i inject finger events ? Changing and compiling CEF is out of my scope.

@amaitland
Copy link
Member

How can i inject finger events ? Changing and compiling CEF is out of my scope.

@Clemani Just download an run cefclient from the link provided with the command line args referenced. If the fling behaviour works there then we can look at implementing it, if not then it's unlikely something CEF supports.

@Clemani
Copy link

Clemani commented Oct 4, 2019

With this commandline args i cannot do anything in cefclient on a web page, finger and pen does not work at all.

@amaitland
Copy link
Member

It appears that Fling scrolling is currently broken in CEF. Relevant issue is https://bitbucket.org/chromiumembedded/cef/issues/2745/osr-fling-scrolling-doesnt-work-in-without

@amaitland
Copy link
Member

It appears that Fling scrolling is currently broken in CEF. Relevant issue is https://bitbucket.org/chromiumembedded/cef/issues/2745/osr-fling-scrolling-doesnt-work-in-without

Fling Scrolling should now be resolved upstream

kkwpsv pushed a commit to kkwpsv/CefSharp that referenced this issue Dec 24, 2019
- Touch support moved from ChromiumWebBrowserWithTouchSupport
- Stylus support was left in ChromiumWebBrowserWithTouchSupport as needs more testing

The CefSharp.Wpf.Example still has System.AppContext.SetSwitch("Switch.System.Windows.Input.Stylus.DisableStylusAndTouchSupport", true);
You will need to remove this for testing

Issue cefsharp#228
@amaitland
Copy link
Member

Touch Support will be part of version 79, Stylus support is still only in the CefSharp.Wpf.Experimental.ChromiumWebBrowserWithTouchSupport class, I've created
#3028 to track progress of resolving the final issues, if you experience problems with Stylus please comment on #3028 instead of here.

Anyone experiencing problems with Touch Support in version 79 or above please open a new issue using the Bug Report Template, please make sure to include a detailed list of steps to reproduce the problem you are seeing.

@amaitland amaitland removed pr-rejected upstream These issues require fixing in the Chromium Embedded Framework(CEF) or Chromium. labels Jan 29, 2020
@amaitland
Copy link
Member

amaitland commented Jan 29, 2020

There is no default virtual keyboard implementation as WPF doesn't provide an out of the box solution that works on all supported operating systems. If you require a virtual keyboard when using your touch screen please read OnScreen Virtual Keyboard. There's some additional information in #1736

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.