5

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

henry60
  • 463
  • 12
  • 24

2 Answers2

5

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;
TLama
  • 75,147
  • 17
  • 214
  • 392
0

@TLama maybe the right code is like this(in dcef3 using delphi7):

    if (event^.kind = KEYEVENT_RAWKEYDOWN) and (event^.windows_key_code = VK_F5) then
Kakash1hatake
  • 128
  • 12