ADD: prompt for gForceFunctionKey authorization after startup

This commit is contained in:
rich2014 2026-03-27 17:05:14 +08:00
commit f98b9a8ece

View file

@ -807,6 +807,7 @@ type
{$IFDEF DARWIN}
procedure GlobalMacOSKeyDownHandler(Sender: TObject; var Key: Word; Shift: TShiftState);
procedure OpenNewWindow(Sender: TObject);
procedure installMacOSFNKeyTap(Sender: TObject; var Done: Boolean);
{$ENDIF}
protected
@ -1267,6 +1268,8 @@ begin
{$IF DEFINED(DARWIN)}
TDarwinApplicationUtil.initServiceProvider( @OnNSServiceOpenWithNewTab, @NSServiceMenuIsReady, @NSServiceMenuGetFilenames );
TDarwinFileViewUtil.init( @ActiveNotebook, @ActiveFrame );
if gForceFunctionKey then
Application.OnIdle:= @installMacOSFNKeyTap;
{$ENDIF}
end;
@ -7439,6 +7442,12 @@ procedure TfrmMain.OpenNewWindow(Sender: TObject);
begin
TDarwinApplicationUtil.openNewInstance;
end;
procedure TfrmMain.installMacOSFNKeyTap(Sender: TObject; var Done: Boolean);
begin
TDarwinApplicationUtil.installFNKeyTap;
Application.OnIdle:= nil;
end;
{$ENDIF}
{$IF (DEFINED(LCLQT) or DEFINED(LCLQT5) or DEFINED(LCLQT6)) and not DEFINED(MSWINDOWS)}