Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.
The mouse's wheel will halt in SimpleOSRBrowser
The mouse's wheel will halt in SimpleOSRBrowser
In the SimpleOSRBrowser Demo, the mouse's wheel sometime will halt after wheel up or down for sometime to scroll the web page. But I still can scroll the web page by the scrollbar at that time.
- salvadordf
- Posts: 4563
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: The mouse's wheel will halt in SimpleOSRBrowser
Hi,
The SimpleOSRBrowser demo intercepts the WM_MOUSEWHEEL message in the TAppEvents.OnMessage event.
This is a simple way to get mouse wheel events but it doesn't work if the user move the mouse outside the form.
If that's what you are experiencing then you can use a low level mouse hook with SetWindowsHookEx and WH_MOUSE_LL to intercept all WM_MOUSEWHEEL messages.
The SimpleOSRBrowser demo intercepts the WM_MOUSEWHEEL message in the TAppEvents.OnMessage event.
This is a simple way to get mouse wheel events but it doesn't work if the user move the mouse outside the form.
If that's what you are experiencing then you can use a low level mouse hook with SetWindowsHookEx and WH_MOUSE_LL to intercept all WM_MOUSEWHEEL messages.
Re: The mouse's wheel will halt in SimpleOSRBrowser
Hi,
It can work even if the user move the mouse outside the form.
But sometime it'll halt, and the web page has no response no matter how the user scroll the mouse wheel.
Until you close the web page and open again, the mouse wheel will work again.
It can work even if the user move the mouse outside the form.
But sometime it'll halt, and the web page has no response no matter how the user scroll the mouse wheel.
Until you close the web page and open again, the mouse wheel will work again.
- salvadordf
- Posts: 4563
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: The mouse's wheel will halt in SimpleOSRBrowser
I've seen something like that with some complex or slow websites that cause the renderer to freeze until some resource is loaded.
Can you reproduce that problem with Chrome after you empty the cache?
Can you reproduce that problem with Chrome after you empty the cache?
Re: The mouse's wheel will halt in SimpleOSRBrowser
Yes, it comes out very often when visit complex websites.
And the problem still exists after I delete all the files and sub directories in the cache directory.
And the problem still exists after I delete all the files and sub directories in the cache directory.
Re: The mouse's wheel will halt in SimpleOSRBrowser
I've solved the problem by cutting down the mouse wheel events. Thank you for your advice.
- salvadordf
- Posts: 4563
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: The mouse's wheel will halt in SimpleOSRBrowser
I just found some information related to this issue. It seems that this problem can be fixed disabling some CEF features.
Try adding this before the GlobalCEFApp.StartMainProcess call in the DPR file :
For reference :
https://bitbucket.org/chromiumembedded/ ... sing-mouse
https://bitbucket.org/chromiumembedded/ ... ional-with
Try adding this before the GlobalCEFApp.StartMainProcess call in the DPR file :
Code: Select all
GlobalCEFApp.SmoothScrolling := STATE_DISABLED;
GlobalCEFApp.DisableFeatures := 'TouchpadAndWheelScrollLatching,AsyncWheelEvents';
https://bitbucket.org/chromiumembedded/ ... sing-mouse
https://bitbucket.org/chromiumembedded/ ... ional-with
Re: The mouse's wheel will halt in SimpleOSRBrowser
Sorry, I just see your response now. Thank you for your suggestions!
I test it in OSR Demo program according to your advice. It works!
I just use "GlobalCEFApp.SmoothScrolling := STATE_DISABLED".
Maybe my cef4delphi version is a little old, GlobalCEFApp doesn't support DisableFeatures attribute.
But is still work without "GlobalCEFApp.DisableFeatures := 'TouchpadAndWheelScrollLatching,AsyncWheelEvents"
I test it in OSR Demo program according to your advice. It works!
I just use "GlobalCEFApp.SmoothScrolling := STATE_DISABLED".
Maybe my cef4delphi version is a little old, GlobalCEFApp doesn't support DisableFeatures attribute.
But is still work without "GlobalCEFApp.DisableFeatures := 'TouchpadAndWheelScrollLatching,AsyncWheelEvents"