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.
middle mouse button
middle mouse button
How to assign your own action to the middle mouse button click?
- salvadordf
- Posts: 4094
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: middle mouse button
If you're using a browser in "normal" mode then try intercepting the Windows message using the TChromium.OnRenderCompMsg event.
If your application uses the OSR mode then all you have to do is implement your code in the OnMouseUp or OnMouseDown events of the buffer panel.
If your application uses the OSR mode then all you have to do is implement your code in the OnMouseUp or OnMouseDown events of the buffer panel.
Re: middle mouse button
How do I know which Chromium triggered this event?
- salvadordf
- Posts: 4094
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: middle mouse button
In case of OSR browsers you should have a one to one relation between a buffer panel and a TCromium component.
If you get a OnMouseDown event in that buffer panel then you know it's related to the only browser using that panel.
If you get a OnMouseDown event in that buffer panel then you know it's related to the only browser using that panel.
Re: middle mouse button
I'm trying to do this:
But I don't understand how to understand what Chromium it caused =(
Code: Select all
Chromium->OnRenderCompMsg = RenderCompMsg;
Code: Select all
void __fastcall TForm1::RenderCompMsg(Winapi::Messages::TMessage &aMessage, bool &aHandled){
if(aMessage.Msg==WM_MBUTTONDOWN){
aHandled = true;
// ???
}
}
- salvadordf
- Posts: 4094
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: middle mouse button
Sorry. I though you were using the OSR mode.
In normal mode you would assign a different procedure to handle the OnRenderCompMsg event of each browser.
I see now that I should add a "Sender" parameter to those events to make this easier.
In normal mode you would assign a different procedure to handle the OnRenderCompMsg event of each browser.
I see now that I should add a "Sender" parameter to those events to make this easier.
- salvadordf
- Posts: 4094
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: middle mouse button
Please, download CEF4Delphi again from GitHub.
I just uploaded a new CEF4Delphi version and now all TChromium events have a "Sender" parameter, including "OnRenderCompMsg".
Use "Sender" like this to know which browser triggered that event :
Each browser has a unique "BrowserId" property.
I just uploaded a new CEF4Delphi version and now all TChromium events have a "Sender" parameter, including "OnRenderCompMsg".
Use "Sender" like this to know which browser triggered that event :
Code: Select all
TChromium(Sender).BrowserId
Re: middle mouse button
Thank you very much.