mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-11 11:39:19 +02:00
cocoa: restore key processing, to let hot keys to triggers... odd
git-svn-id: trunk@59141 -
This commit is contained in:
parent
fdfa68c0e2
commit
56723694f9
@ -614,8 +614,7 @@ begin
|
||||
begin
|
||||
cb.KeyEvPrepare(event);
|
||||
cb.KeyEvBefore(res);
|
||||
//there's no keyDown below! expect for *ding*
|
||||
//if res then inherited keyDown(event);
|
||||
if res then inherited keyDown(event);
|
||||
cb.KeyEvAfter;
|
||||
end else
|
||||
inherited keyDown(event);
|
||||
|
@ -52,6 +52,7 @@ type
|
||||
Owner: NSObject;
|
||||
HandleFrame: NSView; // HWND and "frame" (rectangle) of the a control
|
||||
BlockCocoaUpDown: Boolean;
|
||||
BlockCocoaKeyDown: Boolean;
|
||||
SuppressTabDown: Boolean; // all tabs should be suppressed, so Cocoa would not switch focus
|
||||
|
||||
class constructor Create;
|
||||
@ -962,8 +963,13 @@ begin
|
||||
AllowCocoaHandle := true;
|
||||
if _IsKeyDown then begin
|
||||
KeyEvBeforeDown(AllowCocoaHandle);
|
||||
if AllowCocoaHandle and SuppressTabDown and (_KeyMsg.CharCode = VK_TAB) then
|
||||
AllowCocoaHandle := false;
|
||||
if AllowCocoaHandle then
|
||||
begin
|
||||
if SuppressTabDown and (_KeyMsg.CharCode = VK_TAB) then
|
||||
AllowCocoaHandle := false
|
||||
else if BlockCocoaKeyDown then
|
||||
AllowCocoaHandle := false;
|
||||
end;
|
||||
end else
|
||||
KeyEvBeforeUp(AllowCocoaHandle);
|
||||
end;
|
||||
@ -1902,6 +1908,7 @@ begin
|
||||
ctrl := TCocoaCustomControl(TCocoaCustomControl.alloc.lclInitWithCreateParams(AParams));
|
||||
lcl := TLCLCommonCallback.Create(ctrl, AWinControl);
|
||||
lcl.BlockCocoaUpDown := true;
|
||||
lcl.BlockCocoaKeyDown := true; // prevent "dings" on keyDown for custom controls (i.e. SynEdit)
|
||||
ctrl.callback := lcl;
|
||||
|
||||
sl := EmbedInManualScrollView(ctrl);
|
||||
|
Loading…
Reference in New Issue
Block a user