Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delphi Chromium Embedded - Refresh page with F5

I am using Delphi Chromium Embedded in my application, and I have the following question: How can I emulate F5 key to refresh page ?

like image 950
henry60 Avatar asked Apr 18 '13 10:04

henry60


1 Answers

In the OnKeyEvent use the following code:

uses
  CEFLib;

procedure TForm1.Chromium1KeyEvent(Sender: TObject;
  const browser: ICefBrowser; event: TCefHandlerKeyEventType; code,
  modifiers: Integer; isSystemKey: Boolean; out Result: Boolean);
begin
  if (event = KEYEVENT_RAWKEYDOWN) and (code = VK_F5) then
  begin
    Result := True;
    Chromium1.Browser.Reload;
  end;
end;
like image 64
TLama Avatar answered Nov 05 '22 20:11

TLama