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.
Disable Mouse / Contextmenu
Disable Mouse / Contextmenu
Is it possible to disable Contextmenu (right click) or to complete every mouse action like move, click ...?
- salvadordf
- Posts: 4080
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Disable Mouse / Contextmenu
According to the CefContextMenuHandler docs :
http://magpcss.org/ceforum/apidocs3/pro ... enuModel>)
You must call model.clear inside the TChromium.OnBeforeContextMenu to disable the context menu.
http://magpcss.org/ceforum/apidocs3/pro ... enuModel>)
You must call model.clear inside the TChromium.OnBeforeContextMenu to disable the context menu.
Re: Disable Mouse / Contextmenu
Perfect, thank you. Please let me ask 2 more questions:
- Is it possible to disable every mouse event (move, click ...)? For example, i don't want to see the timeline from youtube if i move the mouse
- Is it possble to dynamically load Chromium Engine only if i need it?
- Is it possible to disable every mouse event (move, click ...)? For example, i don't want to see the timeline from youtube if i move the mouse
- Is it possble to dynamically load Chromium Engine only if i need it?
- salvadordf
- Posts: 4080
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Disable Mouse / Contextmenu
There are several tricks you can use :
- The easiest way : Configure TChromium to be an OSR component. Check the SimpleOSRBrowser and you'll see that you have better control of mouse and keyboard events that way.
- A transparent panel in front of TCEFWindowParent in non OSR TChromium configuration. I haven't tested this but I remember that it was one of the recommedations for TWebBrowser.
- Low level mouse hooks https://msdn.microsoft.com/en-us/librar ... s.85).aspx
If you mean loading the DLLs only when needed then I'm afraid the answer is no. CEF3 needs to be initialized before the app starts.
If you mean creating the TChromium component at runtime, the answer is yes. BriskBard does that for every tab.
Re: Disable Mouse / Contextmenu
Ok, Thank you, i'll check. A last question for today: If i load a page using IE ActiveX, there's no scrollbar. Using Chromium, there is a scrollbar. Is there a property to disable every scrollbar?
BTW: Many many thanks for your good work. Your package is much better and more stable then CEF3! I love it!
BTW: Many many thanks for your good work. Your package is much better and more stable then CEF3! I love it!
- salvadordf
- Posts: 4080
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Disable Mouse / Contextmenu
Hi :
I'm glad that you like it.
Take a look at the list of command line switches here :
http://peter.sh/experiments/chromium-co ... -switches/
There are several switches that could be what you're looking for :
--enable-overlay-scrollbar
--disable-overlay-scrollbar
--hide-scrollbars
You can try them individually in your DPR file like this :
GlobalCEFApp.AddCustomCommandLine('--enable-overlay-scrollbar', '0');
GlobalCEFApp.AddCustomCommandLine('--disable-overlay-scrollbar');
GlobalCEFApp.AddCustomCommandLine('--hide-scrollbars');
They must be called before the GlobalCEFApp.StartMainProcess. Check the minibrowser demo.
I'm glad that you like it.
Take a look at the list of command line switches here :
http://peter.sh/experiments/chromium-co ... -switches/
There are several switches that could be what you're looking for :
--enable-overlay-scrollbar
--disable-overlay-scrollbar
--hide-scrollbars
You can try them individually in your DPR file like this :
GlobalCEFApp.AddCustomCommandLine('--enable-overlay-scrollbar', '0');
GlobalCEFApp.AddCustomCommandLine('--disable-overlay-scrollbar');
GlobalCEFApp.AddCustomCommandLine('--hide-scrollbars');
They must be called before the GlobalCEFApp.StartMainProcess. Check the minibrowser demo.
Re: Disable Mouse / Contextmenu
Thank you. Do you know if flash is always supported by chromium with the given package or only if flash is installed by the user on the target system? It would be amazing if it always works, because not many users have installed flash player.
- salvadordf
- Posts: 4080
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Disable Mouse / Contextmenu
The users must install the PPAPI Flash plugin and GlobalCEFApp.FlashEnabled must be True (Default value).
That's why I had to add an extra FAQ item :
https://www.briskbard.com/index.php?lang=en&faqitem=208
Edit : If you show Youtube videos it could be enough with HTML5. I'm not 100% sure.
That's why I had to add an extra FAQ item :
https://www.briskbard.com/index.php?lang=en&faqitem=208
Edit : If you show Youtube videos it could be enough with HTML5. I'm not 100% sure.
Re: Disable Mouse / Contextmenu
Do you know if it is possible to check, if flash is available for chromium by the application? For example, if not check flash then...
- salvadordf
- Posts: 4080
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Disable Mouse / Contextmenu
The users can check it here :
http://isflashinstalled.com/
https://www.whatismybrowser.com/detect/ ... -installed
http://www.adobe.com/software/flash/about/
If you need to check it in the code, you could read the list of installed programs in the registry.
http://delphiexamples.com/system/installprog.html
http://isflashinstalled.com/
https://www.whatismybrowser.com/detect/ ... -installed
http://www.adobe.com/software/flash/about/
If you need to check it in the code, you could read the list of installed programs in the registry.
http://delphiexamples.com/system/installprog.html