How to override mouse cursor?

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

How to override mouse cursor?

Postby sandmeteor » Tue Jul 02, 2019 1:29 pm

I have searched many threads, but I have not found any solution.
Can we change the default cursor (not in the application - this is simple) but the one, that is displayed in the CEF window, for example an arrow or hand cursor when it is above the link.
When I change cursor in my application it works fine but only over my application widgets - it does not change cursor in CEF browser window.
sandmeteor
Techie
 
Posts: 17
Joined: Sat Jun 22, 2019 4:25 pm

Re: How to override mouse cursor?

Postby magreenblatt » Tue Jul 02, 2019 1:45 pm

You can change the cursor with CSS/JavaScript.
magreenblatt
Site Admin
 
Posts: 10462
Joined: Fri May 29, 2009 6:57 pm

Re: How to override mouse cursor?

Postby sandmeteor » Tue Jul 02, 2019 2:20 pm

Ok, it's an idea, but:
-When the page is empty (when you create a browser without loading the page - a blank page), it will not work. The cursor is set to an arrow. Even if you do ExecuteJavaScript.
In addition, Otherwise, I need to load my own image from the application as png.

This is work but when page is loaded.
Code: Select all
 browser _-> GetMainFrame () -> ExecuteJavaScript ("document.body.style.cursor = \" progress \ ";", "", 0);


Is it possible in CEF api to override cursor?
sandmeteor
Techie
 
Posts: 17
Joined: Sat Jun 22, 2019 4:25 pm

Re: How to override mouse cursor?

Postby magreenblatt » Tue Jul 02, 2019 2:29 pm

There is a CefBrowserHost::SetMouseCursorChangeDisabled method, but it is not implemented in current CEF versions.
magreenblatt
Site Admin
 
Posts: 10462
Joined: Fri May 29, 2009 6:57 pm

Re: How to override mouse cursor?

Postby sandmeteor » Tue Jul 02, 2019 2:38 pm

Maybe there is a signal from the CEF that tells the mouse is above the link?
sandmeteor
Techie
 
Posts: 17
Joined: Sat Jun 22, 2019 4:25 pm

Re: How to override mouse cursor?

Postby ndesktop » Wed Jul 03, 2019 12:45 am

If you are on Windows, you can try altering the CEF window with SetClassLong(GCL_HCURSOR), or mouse hook+SetCursor, or TrackMouseEvent.
ndesktop
Expert
 
Posts: 447
Joined: Thu Dec 03, 2015 10:10 am

Re: How to override mouse cursor?

Postby ajitchavan » Tue Jul 07, 2020 2:43 am

magreenblatt wrote:There is a CefBrowserHost::SetMouseCursorChangeDisabled method, but it is not implemented in current CEF versions.


Is CefBrowserHost::SetMouseCursorChangeDisabled implemented in cef 83?
ajitchavan
Techie
 
Posts: 12
Joined: Mon Mar 16, 2020 7:03 am

Re: How to override mouse cursor?

Postby magreenblatt » Tue Jul 07, 2020 9:11 am

ajitchavan wrote:
magreenblatt wrote:There is a CefBrowserHost::SetMouseCursorChangeDisabled method, but it is not implemented in current CEF versions.


Is CefBrowserHost::SetMouseCursorChangeDisabled implemented in cef 83?

You can test with ‘cefclient --mouse-cursor-change-disabled‘
magreenblatt
Site Admin
 
Posts: 10462
Joined: Fri May 29, 2009 6:57 pm


Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 32 guests