mirror of
https://github.com/salvadordf/CEF4Delphi.git
synced 2024-11-15 15:55:56 +01:00
Fix TAB key handling in FMX demos in OSR mode
This commit is contained in:
parent
a34ae44cb0
commit
17c82fa24c
@ -102,6 +102,7 @@ object FMXExternalPumpBrowserFrm: TFMXExternalPumpBrowserFrm
|
||||
OnMouseLeave = Panel1MouseLeave
|
||||
OnMouseWheel = Panel1MouseWheel
|
||||
OnKeyDown = Panel1KeyDown
|
||||
OnDialogKey = Panel1DialogKey
|
||||
end
|
||||
object chrmosr: TFMXChromium
|
||||
OnTooltip = chrmosrTooltip
|
||||
|
@ -79,6 +79,7 @@ type
|
||||
procedure Panel1MouseLeave(Sender: TObject);
|
||||
procedure Panel1MouseWheel(Sender: TObject; Shift: TShiftState; WheelDelta: Integer; var Handled: Boolean);
|
||||
procedure Panel1KeyDown(Sender: TObject; var Key: Word; var KeyChar: Char; Shift: TShiftState);
|
||||
procedure Panel1DialogKey(Sender: TObject; var Key: Word; Shift: TShiftState);
|
||||
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
@ -317,6 +318,12 @@ begin
|
||||
Panel1.SetFocus;
|
||||
end;
|
||||
|
||||
procedure TFMXExternalPumpBrowserFrm.Panel1DialogKey(Sender: TObject;
|
||||
var Key: Word; Shift: TShiftState);
|
||||
begin
|
||||
if (Key = vkTab) then Key := 0;
|
||||
end;
|
||||
|
||||
procedure TFMXExternalPumpBrowserFrm.Panel1Enter(Sender: TObject);
|
||||
begin
|
||||
chrmosr.SendFocusEvent(True);
|
||||
@ -351,7 +358,7 @@ begin
|
||||
end
|
||||
else
|
||||
if (Key <> 0) and (KeyChar = #0) and
|
||||
(Key in [VK_LEFT, VK_RIGHT, VK_UP, VK_DOWN, VK_TAB]) then
|
||||
(Key in [vkLeft, vkRight, vkUp, vkDown]) then
|
||||
Key := 0;
|
||||
end;
|
||||
|
||||
@ -978,7 +985,7 @@ var
|
||||
begin
|
||||
if Panel1.IsFocused then
|
||||
begin
|
||||
if (aMessage.wParam = VK_RETURN) then
|
||||
if (aMessage.wParam = vkReturn) then
|
||||
begin
|
||||
TempKeyEvent.kind := KEYEVENT_CHAR;
|
||||
TempKeyEvent.modifiers := GetCefKeyboardModifiers(aMessage.wParam, aMessage.lParam);
|
||||
|
@ -126,6 +126,7 @@ object BrowserFrame: TBrowserFrame
|
||||
OnMouseLeave = FMXBufferPanel1MouseLeave
|
||||
OnMouseWheel = FMXBufferPanel1MouseWheel
|
||||
OnKeyDown = FMXBufferPanel1KeyDown
|
||||
OnDialogKey = FMXBufferPanel1DialogKey
|
||||
end
|
||||
object FMXChromium1: TFMXChromium
|
||||
OnLoadError = FMXChromium1LoadError
|
||||
|
@ -82,6 +82,7 @@ type
|
||||
procedure FMXBufferPanel1MouseLeave(Sender: TObject);
|
||||
procedure FMXBufferPanel1MouseWheel(Sender: TObject; Shift: TShiftState; WheelDelta: Integer; var Handled: Boolean);
|
||||
procedure FMXBufferPanel1KeyDown(Sender: TObject; var Key: Word; var KeyChar: Char; Shift: TShiftState);
|
||||
procedure FMXBufferPanel1DialogKey(Sender: TObject; var Key: Word; Shift: TShiftState);
|
||||
|
||||
procedure FMXChromium1AfterCreated(Sender: TObject; const browser: ICefBrowser);
|
||||
procedure FMXChromium1BeforeClose(Sender: TObject; const browser: ICefBrowser);
|
||||
@ -265,6 +266,12 @@ begin
|
||||
FocusBrowser;
|
||||
end;
|
||||
|
||||
procedure TBrowserFrame.FMXBufferPanel1DialogKey(Sender: TObject; var Key: Word;
|
||||
Shift: TShiftState);
|
||||
begin
|
||||
if (Key = vkTab) then Key := 0;
|
||||
end;
|
||||
|
||||
procedure TBrowserFrame.FMXBufferPanel1Enter(Sender: TObject);
|
||||
begin
|
||||
FMXChromium1.SendFocusEvent(True);
|
||||
@ -297,7 +304,7 @@ begin
|
||||
end
|
||||
else
|
||||
if (Key <> 0) and (KeyChar = #0) and
|
||||
(Key in [VK_LEFT, VK_RIGHT, VK_UP, VK_DOWN, VK_TAB]) then
|
||||
(Key in [vkLeft, vkRight, vkUp, vkDown]) then
|
||||
Key := 0;
|
||||
end;
|
||||
|
||||
@ -1069,7 +1076,7 @@ var
|
||||
begin
|
||||
if FMXBufferPanel1.IsFocused then
|
||||
begin
|
||||
if (aMessage.wParam = VK_RETURN) then
|
||||
if (aMessage.wParam = vkReturn) then
|
||||
begin
|
||||
TempKeyEvent.kind := KEYEVENT_CHAR;
|
||||
TempKeyEvent.modifiers := GetCefKeyboardModifiers(aMessage.wParam, aMessage.lParam);
|
||||
|
@ -2,7 +2,7 @@
|
||||
"UpdateLazPackages" : [
|
||||
{
|
||||
"ForceNotify" : true,
|
||||
"InternalVersion" : 125,
|
||||
"InternalVersion" : 126,
|
||||
"Name" : "cef4delphi_lazarus.lpk",
|
||||
"Version" : "81.2.24.0"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user