Zoom In/Out using CTRL + MW

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.

Zoom In/Out using CTRL + MW

Postby CosminD » Mon Jan 07, 2019 8:30 am

Hello,

Is it possible to capture mouse wheel events similar to how we can capture keyboard events by providing a CefKeyboardHandler?
I'm trying to figure out how to zoom in and out using CTRL + MouseWheel, but I cannot capture the MW events.

Any help is greatly appreciated :D
CosminD
Newbie
 
Posts: 4
Joined: Mon Dec 17, 2018 3:15 am

Re: Zoom In/Out using CTRL + MW

Postby salvadordf » Mon Jan 07, 2019 9:43 am

You will need a low level mouse hook for that.
Maintainer of the CEF4Delphi, WebView4Delphi, WebUI4Delphi and WebUI4CSharp projects.
User avatar
salvadordf
Expert
 
Posts: 129
Joined: Sun Dec 18, 2016 8:39 am
Location: Spain

Re: Zoom In/Out using CTRL + MW

Postby ndesktop » Mon Jan 07, 2019 10:58 am

You might want also to throw the TrackMouseEvent/SetWinEventHook + EVENT_OBJECT_FOCUS and EVENT_OBJECT_SELECTION combo for detection.
ndesktop
Master
 
Posts: 756
Joined: Thu Dec 03, 2015 10:10 am

Re: Zoom In/Out using CTRL + MW

Postby Czarek » Mon Jan 07, 2019 2:39 pm

Alternatively you can capture events in javascript and communicate with C++ via javascript bindings.
Maintainer of the CEF Python, PHP Desktop and CEF C API projects. My LinkedIn.
User avatar
Czarek
Virtuoso
 
Posts: 1927
Joined: Sun Nov 06, 2011 2:12 am

Re: Zoom In/Out using CTRL + MW

Postby mezdej » Thu Oct 24, 2019 1:20 am

Why zooming with mouse wheel is not implemented by default?
Do we really have to use hooks or window subclass to handle it by ourselves? If so then why normal scroll is handled by cef/chromium?
Last edited by mezdej on Fri Oct 25, 2019 2:50 am, edited 1 time in total.
mezdej
Techie
 
Posts: 31
Joined: Tue Oct 22, 2013 3:56 am

Re: Zoom In/Out using CTRL + MW

Postby ndesktop » Thu Oct 24, 2019 6:38 am

"zooming with mouse" is implemented, I suppose, otherwise it will not work.
But the initial post says "capture mouse wheel events". "capture" is an entire differently beast.
ndesktop
Master
 
Posts: 756
Joined: Thu Dec 03, 2015 10:10 am

Re: Zoom In/Out using CTRL + MW

Postby mezdej » Fri Oct 25, 2019 2:54 am

ndesktop wrote:"zooming with mouse" is implemented,

No it's not. If it was this topic would not exist.

ndesktop wrote:But the initial post says "capture mouse wheel events".

Capture in order to achive ability of changing browser zoom using "control" key with mouse wheel.
mezdej
Techie
 
Posts: 31
Joined: Tue Oct 22, 2013 3:56 am


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 190 guests