2

I need to open link in new Tab, if its where pressed with middle mouse button, but exactly there is no Events in TChromium, like OnMouseDown or else. There is only OnPreKeyEvent and OnKeyEvent, but exactly its not what i need. I allmost tryed to catch this click with this Events, like this:

procedure TForm1.ChromiumPreKeyEvent(Sender: TObject;
  const browser: ICefBrowser; const event: PCefKeyEvent; osEvent: PMsg;
  out isKeyboardShortcut, Result: Boolean);
begin
  If(event.windows_key_code=13) Then
  ShowMessage('ENTER PRESSED PRE KEY EVENT : '+inttostr(event.windows_key_code))
end;

But its exactly not working with mouse buttons. Can somebody help me with this ? Thanks.

Sir Rufo
  • 18,395
  • 2
  • 39
  • 73
Priler
  • 149
  • 1
  • 10
  • 1
    [`DCEF`](https://code.google.com/p/delphichromiumembedded/) or [`DCEF3`](https://code.google.com/p/dcef3/) ? – TLama Jul 31 '13 at 17:06
  • Ok, so how i need to do what i need ? – Priler Jul 31 '13 at 18:06
  • Thanks! Anyway, if you want to notify someone by comment, use `@` before the name of the user, like e.g. `@TLama`. We don't need to use this because you are the original poster of the question and so you'll be notified always. But to the problem. Mouse wheel click in DCEF3 doesn't open a popup window like DCEF did. I'll take a look closer on this and try to search the CEF3 (original C++ CEF) forums. – TLama Jul 31 '13 at 18:13
  • @TLama, Thanks! Big tanks to you for that :) What diferrent of DCEF with DCEF3 ? – Priler Jul 31 '13 at 18:15
  • Hm, I'd say that [`it's not so easy`](http://magpcss.org/ceforum/viewtopic.php?f=14&t=10755). Even if you'll be able to catch the start of the navigation and cancel it by using the [`CefRenderProcessHandler::OnBeforeNavigation`](http://magpcss.org/ceforum/apidocs3/projects/(default)/CefRenderProcessHandler.html#OnBeforeNavigation) event. You'll also determine the source of the navigation (`NavigationType == NAVIGATION_LINK_CLICKED`), but you won't be able to determine which mouse button invoked that event, if left, or middle... – TLama Jul 31 '13 at 19:41
  • Wow, so how i need to do that? Please, help me – Priler Aug 01 '13 at 08:07
  • I can't catch CefRenderProcessHandler, how i need to do that? – Priler Aug 01 '13 at 10:53
  • That's what I couldn't figure out yet. But even then, you won't recognize which button invoked that navigation. The `NAVIGATION_LINK_CLICKED` value you'll get in the `NavigationType` parameter even for the left mouse button. – TLama Aug 01 '13 at 14:42
  • Where i can find this NavigationType ? Please, help me to fix this – Priler Aug 05 '13 at 11:22
  • Or MayBe i can change my DCEF3 to DCEF1 ? – Priler Aug 05 '13 at 11:25

0 Answers0