You've already forked CEF4Delphi
mirror of
https://github.com/salvadordf/CEF4Delphi.git
synced 2025-07-12 22:30:17 +02:00
Fixed accented characters issue in web pages
This commit is contained in:
@ -75,13 +75,8 @@ type
|
|||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses
|
uses
|
||||||
FMX.Forms,
|
FMX.Forms, {$IFDEF MSWINDOWS}Winapi.Messages, Winapi.Windows,{$ENDIF}
|
||||||
uFMXExternalPumpBrowser,
|
uFMXExternalPumpBrowser, uCEFFMXWorkScheduler, uCEFApplication, uCEFConstants;
|
||||||
uCEFFMXWorkScheduler,
|
|
||||||
{$IFDEF MSWINDOWS}
|
|
||||||
Winapi.Messages, Winapi.Windows,
|
|
||||||
{$ENDIF}
|
|
||||||
uCEFApplication, uCEFConstants;
|
|
||||||
|
|
||||||
class procedure TFMXApplicationService.AddPlatformService;
|
class procedure TFMXApplicationService.AddPlatformService;
|
||||||
begin
|
begin
|
||||||
@ -198,6 +193,18 @@ begin
|
|||||||
(Application.MainForm is TFMXExternalPumpBrowserFrm) then
|
(Application.MainForm is TFMXExternalPumpBrowserFrm) then
|
||||||
TFMXExternalPumpBrowserFrm(Application.MainForm).HandleSYSKEYUP(TempMsg);
|
TFMXExternalPumpBrowserFrm(Application.MainForm).HandleSYSKEYUP(TempMsg);
|
||||||
|
|
||||||
|
WM_KEYDOWN :
|
||||||
|
if not(Application.Terminated) and
|
||||||
|
(Application.MainForm <> nil) and
|
||||||
|
(Application.MainForm is TFMXExternalPumpBrowserFrm) then
|
||||||
|
TFMXExternalPumpBrowserFrm(Application.MainForm).HandleKEYDOWN(TempMsg);
|
||||||
|
|
||||||
|
WM_KEYUP :
|
||||||
|
if not(Application.Terminated) and
|
||||||
|
(Application.MainForm <> nil) and
|
||||||
|
(Application.MainForm is TFMXExternalPumpBrowserFrm) then
|
||||||
|
TFMXExternalPumpBrowserFrm(Application.MainForm).HandleKEYUP(TempMsg);
|
||||||
|
|
||||||
WM_POINTERDOWN,
|
WM_POINTERDOWN,
|
||||||
WM_POINTERUPDATE,
|
WM_POINTERUPDATE,
|
||||||
WM_POINTERUP :
|
WM_POINTERUP :
|
||||||
|
@ -101,7 +101,6 @@ object FMXExternalPumpBrowserFrm: TFMXExternalPumpBrowserFrm
|
|||||||
OnMouseUp = Panel1MouseUp
|
OnMouseUp = Panel1MouseUp
|
||||||
OnMouseLeave = Panel1MouseLeave
|
OnMouseLeave = Panel1MouseLeave
|
||||||
OnMouseWheel = Panel1MouseWheel
|
OnMouseWheel = Panel1MouseWheel
|
||||||
OnKeyUp = Panel1KeyUp
|
|
||||||
OnKeyDown = Panel1KeyDown
|
OnKeyDown = Panel1KeyDown
|
||||||
end
|
end
|
||||||
object chrmosr: TFMXChromium
|
object chrmosr: TFMXChromium
|
||||||
|
@ -78,7 +78,6 @@ type
|
|||||||
procedure Panel1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Single);
|
procedure Panel1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Single);
|
||||||
procedure Panel1MouseLeave(Sender: TObject);
|
procedure Panel1MouseLeave(Sender: TObject);
|
||||||
procedure Panel1MouseWheel(Sender: TObject; Shift: TShiftState; WheelDelta: Integer; var Handled: Boolean);
|
procedure Panel1MouseWheel(Sender: TObject; Shift: TShiftState; WheelDelta: Integer; var Handled: Boolean);
|
||||||
procedure Panel1KeyUp(Sender: TObject; var Key: Word; var KeyChar: Char; Shift: TShiftState);
|
|
||||||
procedure Panel1KeyDown(Sender: TObject; var Key: Word; var KeyChar: Char; Shift: TShiftState);
|
procedure Panel1KeyDown(Sender: TObject; var Key: Word; var KeyChar: Char; Shift: TShiftState);
|
||||||
|
|
||||||
procedure FormCreate(Sender: TObject);
|
procedure FormCreate(Sender: TObject);
|
||||||
@ -101,6 +100,7 @@ type
|
|||||||
|
|
||||||
procedure Timer1Timer(Sender: TObject);
|
procedure Timer1Timer(Sender: TObject);
|
||||||
procedure AddressEdtEnter(Sender: TObject);
|
procedure AddressEdtEnter(Sender: TObject);
|
||||||
|
|
||||||
procedure SnapshotBtnClick(Sender: TObject);
|
procedure SnapshotBtnClick(Sender: TObject);
|
||||||
procedure SnapshotBtnEnter(Sender: TObject);
|
procedure SnapshotBtnEnter(Sender: TObject);
|
||||||
|
|
||||||
@ -146,6 +146,8 @@ type
|
|||||||
procedure HandleSYSCHAR(const aMessage : TMsg);
|
procedure HandleSYSCHAR(const aMessage : TMsg);
|
||||||
procedure HandleSYSKEYDOWN(const aMessage : TMsg);
|
procedure HandleSYSKEYDOWN(const aMessage : TMsg);
|
||||||
procedure HandleSYSKEYUP(const aMessage : TMsg);
|
procedure HandleSYSKEYUP(const aMessage : TMsg);
|
||||||
|
procedure HandleKEYDOWN(const aMessage : TMsg);
|
||||||
|
procedure HandleKEYUP(const aMessage : TMsg);
|
||||||
function HandlePOINTER(const aMessage : TMsg) : boolean;
|
function HandlePOINTER(const aMessage : TMsg) : boolean;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
@ -212,6 +214,8 @@ begin
|
|||||||
GlobalCEFApp.MultiThreadedMessageLoop := False;
|
GlobalCEFApp.MultiThreadedMessageLoop := False;
|
||||||
GlobalCEFApp.OnScheduleMessagePumpWork := GlobalCEFApp_OnScheduleMessagePumpWork;
|
GlobalCEFApp.OnScheduleMessagePumpWork := GlobalCEFApp_OnScheduleMessagePumpWork;
|
||||||
//GlobalCEFApp.EnableGPU := True;
|
//GlobalCEFApp.EnableGPU := True;
|
||||||
|
//GlobalCEFApp.LogFile := 'debug.log';
|
||||||
|
//GlobalCEFApp.LogSeverity := LOGSEVERITY_INFO;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TFMXExternalPumpBrowserFrm.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
|
procedure TFMXExternalPumpBrowserFrm.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
|
||||||
@ -332,32 +336,6 @@ var
|
|||||||
begin
|
begin
|
||||||
if not(Panel1.IsFocused) then exit;
|
if not(Panel1.IsFocused) then exit;
|
||||||
|
|
||||||
if (Key <> 0) and (KeyChar = #0) then
|
|
||||||
begin
|
|
||||||
TempKeyEvent.kind := KEYEVENT_RAWKEYDOWN;
|
|
||||||
TempKeyEvent.modifiers := getModifiers(Shift);
|
|
||||||
TempKeyEvent.windows_key_code := Key;
|
|
||||||
TempKeyEvent.native_key_code := 0;
|
|
||||||
TempKeyEvent.is_system_key := ord(False);
|
|
||||||
TempKeyEvent.character := #0;
|
|
||||||
TempKeyEvent.unmodified_character := #0;
|
|
||||||
TempKeyEvent.focus_on_editable_field := ord(False);
|
|
||||||
|
|
||||||
chrmosr.SendKeyEvent(@TempKeyEvent);
|
|
||||||
|
|
||||||
if (Key in [VK_LEFT, VK_RIGHT, VK_UP, VK_DOWN, VK_TAB]) then Key := 0;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TFMXExternalPumpBrowserFrm.Panel1KeyUp( Sender : TObject;
|
|
||||||
var Key : Word;
|
|
||||||
var KeyChar : Char;
|
|
||||||
Shift : TShiftState);
|
|
||||||
var
|
|
||||||
TempKeyEvent : TCefKeyEvent;
|
|
||||||
begin
|
|
||||||
if not(Panel1.IsFocused) then exit;
|
|
||||||
|
|
||||||
if (Key = 0) and (KeyChar <> #0) then
|
if (Key = 0) and (KeyChar <> #0) then
|
||||||
begin
|
begin
|
||||||
TempKeyEvent.kind := KEYEVENT_CHAR;
|
TempKeyEvent.kind := KEYEVENT_CHAR;
|
||||||
@ -372,36 +350,9 @@ begin
|
|||||||
chrmosr.SendKeyEvent(@TempKeyEvent);
|
chrmosr.SendKeyEvent(@TempKeyEvent);
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if (Key <> 0) and (KeyChar = #0) then
|
if (Key <> 0) and (KeyChar = #0) and
|
||||||
begin
|
(Key in [VK_LEFT, VK_RIGHT, VK_UP, VK_DOWN, VK_TAB]) then
|
||||||
if (Key = VK_RETURN) then
|
Key := 0;
|
||||||
begin
|
|
||||||
// FMX doesn't trigger this event with a KeyChar<>0
|
|
||||||
// to send a KEYEVENT_CHAR event for the VK_RETURN key.
|
|
||||||
// We add it manually before the KEYEVENT_KEYUP event.
|
|
||||||
TempKeyEvent.kind := KEYEVENT_CHAR;
|
|
||||||
TempKeyEvent.modifiers := getModifiers(Shift);
|
|
||||||
TempKeyEvent.windows_key_code := VK_RETURN;
|
|
||||||
TempKeyEvent.native_key_code := 0;
|
|
||||||
TempKeyEvent.is_system_key := ord(False);
|
|
||||||
TempKeyEvent.character := #0;
|
|
||||||
TempKeyEvent.unmodified_character := #0;
|
|
||||||
TempKeyEvent.focus_on_editable_field := ord(False);
|
|
||||||
|
|
||||||
chrmosr.SendKeyEvent(@TempKeyEvent);
|
|
||||||
end;
|
|
||||||
|
|
||||||
TempKeyEvent.kind := KEYEVENT_KEYUP;
|
|
||||||
TempKeyEvent.modifiers := getModifiers(Shift);
|
|
||||||
TempKeyEvent.windows_key_code := Key;
|
|
||||||
TempKeyEvent.native_key_code := 0;
|
|
||||||
TempKeyEvent.is_system_key := ord(False);
|
|
||||||
TempKeyEvent.character := #0;
|
|
||||||
TempKeyEvent.unmodified_character := #0;
|
|
||||||
TempKeyEvent.focus_on_editable_field := ord(False);
|
|
||||||
|
|
||||||
chrmosr.SendKeyEvent(@TempKeyEvent);
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TFMXExternalPumpBrowserFrm.Panel1MouseDown(Sender : TObject;
|
procedure TFMXExternalPumpBrowserFrm.Panel1MouseDown(Sender : TObject;
|
||||||
@ -1002,6 +953,58 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TFMXExternalPumpBrowserFrm.HandleKEYDOWN(const aMessage : TMsg);
|
||||||
|
var
|
||||||
|
TempKeyEvent : TCefKeyEvent;
|
||||||
|
begin
|
||||||
|
if Panel1.IsFocused then
|
||||||
|
begin
|
||||||
|
TempKeyEvent.kind := KEYEVENT_RAWKEYDOWN;
|
||||||
|
TempKeyEvent.modifiers := GetCefKeyboardModifiers(aMessage.wParam, aMessage.lParam);
|
||||||
|
TempKeyEvent.windows_key_code := integer(aMessage.wParam);
|
||||||
|
TempKeyEvent.native_key_code := integer(aMessage.lParam);
|
||||||
|
TempKeyEvent.is_system_key := ord(False);
|
||||||
|
TempKeyEvent.character := #0;
|
||||||
|
TempKeyEvent.unmodified_character := #0;
|
||||||
|
TempKeyEvent.focus_on_editable_field := ord(False);
|
||||||
|
|
||||||
|
chrmosr.SendKeyEvent(@TempKeyEvent);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TFMXExternalPumpBrowserFrm.HandleKEYUP(const aMessage : TMsg);
|
||||||
|
var
|
||||||
|
TempKeyEvent : TCefKeyEvent;
|
||||||
|
begin
|
||||||
|
if Panel1.IsFocused then
|
||||||
|
begin
|
||||||
|
if (aMessage.wParam = VK_RETURN) then
|
||||||
|
begin
|
||||||
|
TempKeyEvent.kind := KEYEVENT_CHAR;
|
||||||
|
TempKeyEvent.modifiers := GetCefKeyboardModifiers(aMessage.wParam, aMessage.lParam);
|
||||||
|
TempKeyEvent.windows_key_code := integer(aMessage.wParam);
|
||||||
|
TempKeyEvent.native_key_code := integer(aMessage.lParam);
|
||||||
|
TempKeyEvent.is_system_key := ord(False);
|
||||||
|
TempKeyEvent.character := #0;
|
||||||
|
TempKeyEvent.unmodified_character := #0;
|
||||||
|
TempKeyEvent.focus_on_editable_field := ord(False);
|
||||||
|
|
||||||
|
chrmosr.SendKeyEvent(@TempKeyEvent);
|
||||||
|
end;
|
||||||
|
|
||||||
|
TempKeyEvent.kind := KEYEVENT_KEYUP;
|
||||||
|
TempKeyEvent.modifiers := GetCefKeyboardModifiers(aMessage.wParam, aMessage.lParam);
|
||||||
|
TempKeyEvent.windows_key_code := integer(aMessage.wParam);
|
||||||
|
TempKeyEvent.native_key_code := integer(aMessage.lParam);
|
||||||
|
TempKeyEvent.is_system_key := ord(False);
|
||||||
|
TempKeyEvent.character := #0;
|
||||||
|
TempKeyEvent.unmodified_character := #0;
|
||||||
|
TempKeyEvent.focus_on_editable_field := ord(False);
|
||||||
|
|
||||||
|
chrmosr.SendKeyEvent(@TempKeyEvent);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
function TFMXExternalPumpBrowserFrm.HandlePOINTER(const aMessage : TMsg) : boolean;
|
function TFMXExternalPumpBrowserFrm.HandlePOINTER(const aMessage : TMsg) : boolean;
|
||||||
begin
|
begin
|
||||||
Result := Panel1.IsFocused and
|
Result := Panel1.IsFocused and
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
<MainSource>FMXTabbedBrowser.dpr</MainSource>
|
<MainSource>FMXTabbedBrowser.dpr</MainSource>
|
||||||
<Base>True</Base>
|
<Base>True</Base>
|
||||||
<Config Condition="'$(Config)'==''">Debug</Config>
|
<Config Condition="'$(Config)'==''">Debug</Config>
|
||||||
<Platform Condition="'$(Platform)'==''">Win32</Platform>
|
<Platform Condition="'$(Platform)'==''">Win64</Platform>
|
||||||
<TargetedPlatforms>3</TargetedPlatforms>
|
<TargetedPlatforms>3</TargetedPlatforms>
|
||||||
<AppType>Application</AppType>
|
<AppType>Application</AppType>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
<MainSource>FMXTabbedOSRBrowser.dpr</MainSource>
|
<MainSource>FMXTabbedOSRBrowser.dpr</MainSource>
|
||||||
<Base>True</Base>
|
<Base>True</Base>
|
||||||
<Config Condition="'$(Config)'==''">Debug</Config>
|
<Config Condition="'$(Config)'==''">Debug</Config>
|
||||||
<Platform Condition="'$(Platform)'==''">Win64</Platform>
|
<Platform Condition="'$(Platform)'==''">Win32</Platform>
|
||||||
<TargetedPlatforms>3</TargetedPlatforms>
|
<TargetedPlatforms>3</TargetedPlatforms>
|
||||||
<AppType>Application</AppType>
|
<AppType>Application</AppType>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
@ -125,7 +125,6 @@ object BrowserFrame: TBrowserFrame
|
|||||||
OnMouseUp = FMXBufferPanel1MouseUp
|
OnMouseUp = FMXBufferPanel1MouseUp
|
||||||
OnMouseLeave = FMXBufferPanel1MouseLeave
|
OnMouseLeave = FMXBufferPanel1MouseLeave
|
||||||
OnMouseWheel = FMXBufferPanel1MouseWheel
|
OnMouseWheel = FMXBufferPanel1MouseWheel
|
||||||
OnKeyUp = FMXBufferPanel1KeyUp
|
|
||||||
OnKeyDown = FMXBufferPanel1KeyDown
|
OnKeyDown = FMXBufferPanel1KeyDown
|
||||||
end
|
end
|
||||||
object FMXChromium1: TFMXChromium
|
object FMXChromium1: TFMXChromium
|
||||||
|
@ -81,7 +81,6 @@ type
|
|||||||
procedure FMXBufferPanel1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Single);
|
procedure FMXBufferPanel1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Single);
|
||||||
procedure FMXBufferPanel1MouseLeave(Sender: TObject);
|
procedure FMXBufferPanel1MouseLeave(Sender: TObject);
|
||||||
procedure FMXBufferPanel1MouseWheel(Sender: TObject; Shift: TShiftState; WheelDelta: Integer; var Handled: Boolean);
|
procedure FMXBufferPanel1MouseWheel(Sender: TObject; Shift: TShiftState; WheelDelta: Integer; var Handled: Boolean);
|
||||||
procedure FMXBufferPanel1KeyUp(Sender: TObject; var Key: Word; var KeyChar: Char; Shift: TShiftState);
|
|
||||||
procedure FMXBufferPanel1KeyDown(Sender: TObject; var Key: Word; var KeyChar: Char; Shift: TShiftState);
|
procedure FMXBufferPanel1KeyDown(Sender: TObject; var Key: Word; var KeyChar: Char; Shift: TShiftState);
|
||||||
|
|
||||||
procedure FMXChromium1AfterCreated(Sender: TObject; const browser: ICefBrowser);
|
procedure FMXChromium1AfterCreated(Sender: TObject; const browser: ICefBrowser);
|
||||||
@ -147,6 +146,8 @@ type
|
|||||||
procedure HandleSYSCHAR(const aMessage : TMsg);
|
procedure HandleSYSCHAR(const aMessage : TMsg);
|
||||||
procedure HandleSYSKEYDOWN(const aMessage : TMsg);
|
procedure HandleSYSKEYDOWN(const aMessage : TMsg);
|
||||||
procedure HandleSYSKEYUP(const aMessage : TMsg);
|
procedure HandleSYSKEYUP(const aMessage : TMsg);
|
||||||
|
procedure HandleKEYDOWN(const aMessage : TMsg);
|
||||||
|
procedure HandleKEYUP(const aMessage : TMsg);
|
||||||
function HandlePOINTER(const aMessage : TMsg) : boolean;
|
function HandlePOINTER(const aMessage : TMsg) : boolean;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
|
||||||
@ -281,30 +282,6 @@ var
|
|||||||
TempKeyEvent : TCefKeyEvent;
|
TempKeyEvent : TCefKeyEvent;
|
||||||
begin
|
begin
|
||||||
if not(FMXBufferPanel1.IsFocused) then exit;
|
if not(FMXBufferPanel1.IsFocused) then exit;
|
||||||
|
|
||||||
if (Key <> 0) and (KeyChar = #0) then
|
|
||||||
begin
|
|
||||||
TempKeyEvent.kind := KEYEVENT_RAWKEYDOWN;
|
|
||||||
TempKeyEvent.modifiers := getModifiers(Shift);
|
|
||||||
TempKeyEvent.windows_key_code := Key;
|
|
||||||
TempKeyEvent.native_key_code := 0;
|
|
||||||
TempKeyEvent.is_system_key := ord(False);
|
|
||||||
TempKeyEvent.character := #0;
|
|
||||||
TempKeyEvent.unmodified_character := #0;
|
|
||||||
TempKeyEvent.focus_on_editable_field := ord(False);
|
|
||||||
|
|
||||||
FMXChromium1.SendKeyEvent(@TempKeyEvent);
|
|
||||||
|
|
||||||
if (Key in [VK_LEFT, VK_RIGHT, VK_UP, VK_DOWN, VK_TAB]) then Key := 0;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TBrowserFrame.FMXBufferPanel1KeyUp(Sender: TObject; var Key: Word;
|
|
||||||
var KeyChar: Char; Shift: TShiftState);
|
|
||||||
var
|
|
||||||
TempKeyEvent : TCefKeyEvent;
|
|
||||||
begin
|
|
||||||
if not(FMXBufferPanel1.IsFocused) then exit;
|
|
||||||
|
|
||||||
if (Key = 0) and (KeyChar <> #0) then
|
if (Key = 0) and (KeyChar <> #0) then
|
||||||
begin
|
begin
|
||||||
@ -319,36 +296,9 @@ begin
|
|||||||
|
|
||||||
FMXChromium1.SendKeyEvent(@TempKeyEvent);
|
FMXChromium1.SendKeyEvent(@TempKeyEvent);
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if (Key <> 0) and (KeyChar = #0) then
|
if (Key <> 0) and (KeyChar = #0) and
|
||||||
begin
|
(Key in [VK_LEFT, VK_RIGHT, VK_UP, VK_DOWN, VK_TAB]) then
|
||||||
if (Key = VK_RETURN) then
|
|
||||||
begin
|
|
||||||
// FMX doesn't trigger this event with a KeyChar<>0
|
|
||||||
// to send a KEYEVENT_CHAR event for the VK_RETURN key.
|
|
||||||
// We add it manually before the KEYEVENT_KEYUP event.
|
|
||||||
TempKeyEvent.kind := KEYEVENT_CHAR;
|
|
||||||
TempKeyEvent.modifiers := getModifiers(Shift);
|
|
||||||
TempKeyEvent.windows_key_code := VK_RETURN;
|
|
||||||
TempKeyEvent.native_key_code := 0;
|
|
||||||
TempKeyEvent.is_system_key := ord(False);
|
|
||||||
TempKeyEvent.character := #0;
|
|
||||||
TempKeyEvent.unmodified_character := #0;
|
|
||||||
TempKeyEvent.focus_on_editable_field := ord(False);
|
|
||||||
|
|
||||||
FMXChromium1.SendKeyEvent(@TempKeyEvent);
|
|
||||||
end;
|
|
||||||
|
|
||||||
TempKeyEvent.kind := KEYEVENT_KEYUP;
|
|
||||||
TempKeyEvent.modifiers := getModifiers(Shift);
|
|
||||||
TempKeyEvent.windows_key_code := Key;
|
|
||||||
TempKeyEvent.native_key_code := 0;
|
|
||||||
TempKeyEvent.is_system_key := ord(False);
|
|
||||||
TempKeyEvent.character := #0;
|
|
||||||
TempKeyEvent.unmodified_character := #0;
|
|
||||||
TempKeyEvent.focus_on_editable_field := ord(False);
|
|
||||||
|
|
||||||
FMXChromium1.SendKeyEvent(@TempKeyEvent);
|
|
||||||
Key := 0;
|
Key := 0;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1094,6 +1044,58 @@ begin
|
|||||||
FMXChromium1.SendKeyEvent(@TempKeyEvent);
|
FMXChromium1.SendKeyEvent(@TempKeyEvent);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure TBrowserFrame.HandleKEYDOWN(const aMessage : TMsg);
|
||||||
|
var
|
||||||
|
TempKeyEvent : TCefKeyEvent;
|
||||||
|
begin
|
||||||
|
if FMXBufferPanel1.IsFocused then
|
||||||
|
begin
|
||||||
|
TempKeyEvent.kind := KEYEVENT_RAWKEYDOWN;
|
||||||
|
TempKeyEvent.modifiers := GetCefKeyboardModifiers(aMessage.wParam, aMessage.lParam);
|
||||||
|
TempKeyEvent.windows_key_code := integer(aMessage.wParam);
|
||||||
|
TempKeyEvent.native_key_code := integer(aMessage.lParam);
|
||||||
|
TempKeyEvent.is_system_key := ord(False);
|
||||||
|
TempKeyEvent.character := #0;
|
||||||
|
TempKeyEvent.unmodified_character := #0;
|
||||||
|
TempKeyEvent.focus_on_editable_field := ord(False);
|
||||||
|
|
||||||
|
FMXChromium1.SendKeyEvent(@TempKeyEvent);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TBrowserFrame.HandleKEYUP(const aMessage : TMsg);
|
||||||
|
var
|
||||||
|
TempKeyEvent : TCefKeyEvent;
|
||||||
|
begin
|
||||||
|
if FMXBufferPanel1.IsFocused then
|
||||||
|
begin
|
||||||
|
if (aMessage.wParam = VK_RETURN) then
|
||||||
|
begin
|
||||||
|
TempKeyEvent.kind := KEYEVENT_CHAR;
|
||||||
|
TempKeyEvent.modifiers := GetCefKeyboardModifiers(aMessage.wParam, aMessage.lParam);
|
||||||
|
TempKeyEvent.windows_key_code := integer(aMessage.wParam);
|
||||||
|
TempKeyEvent.native_key_code := integer(aMessage.lParam);
|
||||||
|
TempKeyEvent.is_system_key := ord(False);
|
||||||
|
TempKeyEvent.character := #0;
|
||||||
|
TempKeyEvent.unmodified_character := #0;
|
||||||
|
TempKeyEvent.focus_on_editable_field := ord(False);
|
||||||
|
|
||||||
|
FMXChromium1.SendKeyEvent(@TempKeyEvent);
|
||||||
|
end;
|
||||||
|
|
||||||
|
TempKeyEvent.kind := KEYEVENT_KEYUP;
|
||||||
|
TempKeyEvent.modifiers := GetCefKeyboardModifiers(aMessage.wParam, aMessage.lParam);
|
||||||
|
TempKeyEvent.windows_key_code := integer(aMessage.wParam);
|
||||||
|
TempKeyEvent.native_key_code := integer(aMessage.lParam);
|
||||||
|
TempKeyEvent.is_system_key := ord(False);
|
||||||
|
TempKeyEvent.character := #0;
|
||||||
|
TempKeyEvent.unmodified_character := #0;
|
||||||
|
TempKeyEvent.focus_on_editable_field := ord(False);
|
||||||
|
|
||||||
|
FMXChromium1.SendKeyEvent(@TempKeyEvent);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TBrowserFrame.HandlePOINTER(const aMessage : TMsg) : boolean;
|
function TBrowserFrame.HandlePOINTER(const aMessage : TMsg) : boolean;
|
||||||
|
@ -70,6 +70,8 @@ type
|
|||||||
procedure HandleSYSCHAR(const aMessage : TMsg);
|
procedure HandleSYSCHAR(const aMessage : TMsg);
|
||||||
procedure HandleSYSKEYDOWN(const aMessage : TMsg);
|
procedure HandleSYSKEYDOWN(const aMessage : TMsg);
|
||||||
procedure HandleSYSKEYUP(const aMessage : TMsg);
|
procedure HandleSYSKEYUP(const aMessage : TMsg);
|
||||||
|
procedure HandleKEYDOWN(const aMessage : TMsg);
|
||||||
|
procedure HandleKEYUP(const aMessage : TMsg);
|
||||||
function HandlePOINTER(const aMessage : TMsg) : boolean;
|
function HandlePOINTER(const aMessage : TMsg) : boolean;
|
||||||
function PostFormMessage(aMsg : cardinal; aWParam : WPARAM = 0; aLParam : LPARAM = 0) : boolean;
|
function PostFormMessage(aMsg : cardinal; aWParam : WPARAM = 0; aLParam : LPARAM = 0) : boolean;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
@ -189,6 +191,18 @@ begin
|
|||||||
FBrowserFrame.HandleSYSKEYUP(aMessage);
|
FBrowserFrame.HandleSYSKEYUP(aMessage);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TBrowserTab.HandleKEYDOWN(const aMessage : TMsg);
|
||||||
|
begin
|
||||||
|
if (FBrowserFrame <> nil) then
|
||||||
|
FBrowserFrame.HandleKEYDOWN(aMessage);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TBrowserTab.HandleKEYUP(const aMessage : TMsg);
|
||||||
|
begin
|
||||||
|
if (FBrowserFrame <> nil) then
|
||||||
|
FBrowserFrame.HandleKEYUP(aMessage);
|
||||||
|
end;
|
||||||
|
|
||||||
function TBrowserTab.HandlePOINTER(const aMessage : TMsg) : boolean;
|
function TBrowserTab.HandlePOINTER(const aMessage : TMsg) : boolean;
|
||||||
begin
|
begin
|
||||||
Result := (FBrowserFrame <> nil) and
|
Result := (FBrowserFrame <> nil) and
|
||||||
|
@ -75,11 +75,8 @@ type
|
|||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses
|
uses
|
||||||
FMX.Forms,
|
FMX.Forms, {$IFDEF MSWINDOWS}Winapi.Messages, Winapi.Windows,{$ENDIF}
|
||||||
uMainForm,
|
uMainForm, uCEFFMXWorkScheduler, uCEFApplication, uCEFConstants;
|
||||||
uCEFFMXWorkScheduler,
|
|
||||||
Winapi.Messages, Winapi.Windows,
|
|
||||||
uCEFApplication, uCEFConstants;
|
|
||||||
|
|
||||||
class procedure TFMXApplicationService.AddPlatformService;
|
class procedure TFMXApplicationService.AddPlatformService;
|
||||||
begin
|
begin
|
||||||
@ -196,6 +193,18 @@ begin
|
|||||||
(Application.MainForm is TMainForm) then
|
(Application.MainForm is TMainForm) then
|
||||||
TMainForm(Application.MainForm).HandleSYSKEYUP(TempMsg);
|
TMainForm(Application.MainForm).HandleSYSKEYUP(TempMsg);
|
||||||
|
|
||||||
|
WM_KEYDOWN :
|
||||||
|
if not(Application.Terminated) and
|
||||||
|
(Application.MainForm <> nil) and
|
||||||
|
(Application.MainForm is TMainForm) then
|
||||||
|
TMainForm(Application.MainForm).HandleKEYDOWN(TempMsg);
|
||||||
|
|
||||||
|
WM_KEYUP :
|
||||||
|
if not(Application.Terminated) and
|
||||||
|
(Application.MainForm <> nil) and
|
||||||
|
(Application.MainForm is TMainForm) then
|
||||||
|
TMainForm(Application.MainForm).HandleKEYUP(TempMsg);
|
||||||
|
|
||||||
WM_POINTERDOWN,
|
WM_POINTERDOWN,
|
||||||
WM_POINTERUPDATE,
|
WM_POINTERUPDATE,
|
||||||
WM_POINTERUP :
|
WM_POINTERUP :
|
||||||
|
@ -104,6 +104,8 @@ type
|
|||||||
procedure HandleSYSCHAR(const aMessage : TMsg);
|
procedure HandleSYSCHAR(const aMessage : TMsg);
|
||||||
procedure HandleSYSKEYDOWN(const aMessage : TMsg);
|
procedure HandleSYSKEYDOWN(const aMessage : TMsg);
|
||||||
procedure HandleSYSKEYUP(const aMessage : TMsg);
|
procedure HandleSYSKEYUP(const aMessage : TMsg);
|
||||||
|
procedure HandleKEYDOWN(const aMessage : TMsg);
|
||||||
|
procedure HandleKEYUP(const aMessage : TMsg);
|
||||||
function HandlePOINTER(const aMessage : TMsg) : boolean;
|
function HandlePOINTER(const aMessage : TMsg) : boolean;
|
||||||
function PostCustomMessage(aMsg : cardinal; aWParam : WPARAM = 0; aLParam : LPARAM = 0) : boolean;
|
function PostCustomMessage(aMsg : cardinal; aWParam : WPARAM = 0; aLParam : LPARAM = 0) : boolean;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
@ -423,6 +425,18 @@ begin
|
|||||||
TBrowserTab(BrowserTabCtrl.ActiveTab).HandleSYSKEYUP(aMessage);
|
TBrowserTab(BrowserTabCtrl.ActiveTab).HandleSYSKEYUP(aMessage);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TMainForm.HandleKEYDOWN(const aMessage : TMsg);
|
||||||
|
begin
|
||||||
|
if (BrowserTabCtrl.ActiveTab <> nil) then
|
||||||
|
TBrowserTab(BrowserTabCtrl.ActiveTab).HandleKEYDOWN(aMessage);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TMainForm.HandleKEYUP(const aMessage : TMsg);
|
||||||
|
begin
|
||||||
|
if (BrowserTabCtrl.ActiveTab <> nil) then
|
||||||
|
TBrowserTab(BrowserTabCtrl.ActiveTab).HandleKEYUP(aMessage);
|
||||||
|
end;
|
||||||
|
|
||||||
function TMainForm.HandlePOINTER(const aMessage : TMsg) : boolean;
|
function TMainForm.HandlePOINTER(const aMessage : TMsg) : boolean;
|
||||||
begin
|
begin
|
||||||
Result := (BrowserTabCtrl.ActiveTab <> nil) and
|
Result := (BrowserTabCtrl.ActiveTab <> nil) and
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
<MainSource>FMXToolBoxBrowser.dpr</MainSource>
|
<MainSource>FMXToolBoxBrowser.dpr</MainSource>
|
||||||
<Base>True</Base>
|
<Base>True</Base>
|
||||||
<Config Condition="'$(Config)'==''">Debug</Config>
|
<Config Condition="'$(Config)'==''">Debug</Config>
|
||||||
<Platform Condition="'$(Platform)'==''">Win32</Platform>
|
<Platform Condition="'$(Platform)'==''">Win64</Platform>
|
||||||
<TargetedPlatforms>3</TargetedPlatforms>
|
<TargetedPlatforms>3</TargetedPlatforms>
|
||||||
<AppType>Application</AppType>
|
<AppType>Application</AppType>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
<MainSource>SimpleFMXBrowser.dpr</MainSource>
|
<MainSource>SimpleFMXBrowser.dpr</MainSource>
|
||||||
<Base>True</Base>
|
<Base>True</Base>
|
||||||
<Config Condition="'$(Config)'==''">Debug</Config>
|
<Config Condition="'$(Config)'==''">Debug</Config>
|
||||||
<Platform Condition="'$(Platform)'==''">Win32</Platform>
|
<Platform Condition="'$(Platform)'==''">Win64</Platform>
|
||||||
<TargetedPlatforms>3</TargetedPlatforms>
|
<TargetedPlatforms>3</TargetedPlatforms>
|
||||||
<AppType>Application</AppType>
|
<AppType>Application</AppType>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
Binary file not shown.
@ -2,7 +2,7 @@
|
|||||||
"UpdateLazPackages" : [
|
"UpdateLazPackages" : [
|
||||||
{
|
{
|
||||||
"ForceNotify" : true,
|
"ForceNotify" : true,
|
||||||
"InternalVersion" : 123,
|
"InternalVersion" : 124,
|
||||||
"Name" : "cef4delphi_lazarus.lpk",
|
"Name" : "cef4delphi_lazarus.lpk",
|
||||||
"Version" : "81.2.22.0"
|
"Version" : "81.2.22.0"
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user