Skip to content

Commit

Permalink
Replace Cmd-H with Cmd-9 and handle Cmd-M on macOS (#77)
Browse files Browse the repository at this point in the history
  • Loading branch information
lighterowl authored Dec 22, 2023
1 parent bcd5ee5 commit 1a81ca4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion main.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1501,11 +1501,14 @@ procedure TMainForm.ProcessIniShortCuts;

procedure FixupUnsupportedShortCutKeys;
begin
{$ifdef darwin}
// mac keyboards don't have the insert key but default shortcut assignments
// in .lfm seem to be for all platforms so we have to fix at runtime.
{$ifdef darwin}
if acAddTorrent.ShortCut = VK_INSERT then acAddTorrent.ShortCut := VK_F5;
if (acAddLink.ShortCut and 255) = VK_INSERT then acAddLink.ShortCut := scShift or VK_F5;

// conflicts with the system-global Meta+H shortcut for "hide window"
if (acSetHighPriority.ShortCut and 255) = VK_H then acSetHighPriority.ShortCut := scMeta or VK_9;
{$endif}
end;

Expand Down Expand Up @@ -4247,6 +4250,9 @@ procedure TMainForm.FormKeyDown(Sender: TObject; var Key: Word;
else Key := KeyPressed;
end;
end;
{$ifdef darwin}
if (Shift = [ssMeta]) and (Key = VK_M) then Application.Minimize;
{$endif}

end;

Expand Down

0 comments on commit 1a81ca4

Please sign in to comment.