mirror of
https://github.com/salvadordf/CEF4Delphi.git
synced 2024-11-24 08:02:15 +02:00
MacOS: Get cursor keys to work under OSR
This commit is contained in:
parent
c45c130b33
commit
9346acaaa0
@ -43,6 +43,7 @@ unit uCEFLazarusOsrBrowserWindow;
|
||||
interface
|
||||
|
||||
uses
|
||||
uCEFLazarusCocoa,
|
||||
{$IFDEF FPC}
|
||||
LResources, PropEdits,
|
||||
{$ENDIF}
|
||||
@ -533,6 +534,7 @@ begin
|
||||
if (ssShift in Shift) then Result := Result or EVENTFLAG_SHIFT_DOWN;
|
||||
if (ssAlt in Shift) then Result := Result or EVENTFLAG_ALT_DOWN;
|
||||
if (ssCtrl in Shift) then Result := Result or EVENTFLAG_CONTROL_DOWN;
|
||||
if (ssMeta in Shift) then Result := Result or EVENTFLAG_COMMAND_DOWN;
|
||||
if (ssLeft in Shift) then Result := Result or EVENTFLAG_LEFT_MOUSE_BUTTON;
|
||||
if (ssRight in Shift) then Result := Result or EVENTFLAG_RIGHT_MOUSE_BUTTON;
|
||||
if (ssMiddle in Shift) then Result := Result or EVENTFLAG_MIDDLE_MOUSE_BUTTON;
|
||||
@ -545,6 +547,7 @@ begin
|
||||
if (ssShift in Shift) then Result := Result or EVENTFLAG_SHIFT_DOWN;
|
||||
if (ssAlt in Shift) then Result := Result or EVENTFLAG_ALT_DOWN;
|
||||
if (ssCtrl in Shift) then Result := Result or EVENTFLAG_CONTROL_DOWN;
|
||||
if (ssMeta in Shift) then Result := Result or EVENTFLAG_COMMAND_DOWN;
|
||||
if (ssNum in Shift) then Result := Result or EVENTFLAG_NUM_LOCK_ON;
|
||||
if (ssCaps in Shift) then Result := Result or EVENTFLAG_CAPS_LOCK_ON;
|
||||
end;
|
||||
@ -767,7 +770,11 @@ begin
|
||||
TempKeyEvent.kind := KEYEVENT_RAWKEYDOWN;
|
||||
TempKeyEvent.modifiers := getModifiers(Shift);
|
||||
TempKeyEvent.windows_key_code := Key;
|
||||
{$IFDEF DARWIN} // $IFDEF MACOSX
|
||||
TempKeyEvent.native_key_code := LastMacOsKeyDownCode;
|
||||
{$ELSE}
|
||||
TempKeyEvent.native_key_code := 0;
|
||||
{$ENDIF}
|
||||
TempKeyEvent.is_system_key := ord(False);
|
||||
TempKeyEvent.character := #0;
|
||||
TempKeyEvent.unmodified_character := #0;
|
||||
|
@ -31,7 +31,7 @@ uses
|
||||
{$IFDEF DARWIN} // $IFDEF MACOSX
|
||||
CocoaAll, CocoaInt, Cocoa_Extra,
|
||||
{$ENDIF}
|
||||
Classes, SysUtils;
|
||||
Classes, SysUtils, ctypes;
|
||||
|
||||
{$IFDEF DARWIN} // $IFDEF MACOSX
|
||||
type
|
||||
@ -56,6 +56,7 @@ type
|
||||
|
||||
procedure AddCrDelegate;
|
||||
|
||||
var LastMacOsKeyDownCode: cushort;
|
||||
{$ENDIF}
|
||||
|
||||
implementation
|
||||
@ -156,7 +157,12 @@ var
|
||||
begin
|
||||
CurrentHandling:=isHandlingSendEvent;
|
||||
setHandlingSendEvent(true);
|
||||
if (theEvent.type_ = NSKeyDown)
|
||||
then begin
|
||||
LastMacOsKeyDownCode := theEvent.keyCode;
|
||||
end;
|
||||
inherited;
|
||||
LastMacOsKeyDownCode:=0;
|
||||
setHandlingSendEvent(CurrentHandling);
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user