Skip to content

Commit

Permalink
Prefer Alt+Left/Right as the main back/forward shortcuts because not …
Browse files Browse the repository at this point in the history
…all keyboard layouts have VK_OEM_MINUS, for example French layout hasn't.
  • Loading branch information
martijnlaan committed Jun 28, 2024
1 parent 48826dd commit 3a5b2b9
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions Projects/Src/CompForm.pas
Original file line number Diff line number Diff line change
Expand Up @@ -5429,20 +5429,19 @@ procedure TCompileForm.UpdateKeyMapping;
{ The Nav buttons have no corresponding menu item and also no ShortCut property
so they need special handling }

FBackNavButtonShortCut := ShortCut(VK_LEFT, [ssAlt]);
FForwardNavButtonShortCut := ShortCut(VK_RIGHT, [ssAlt]);

case FOptions.KeyMappingType of
kmtDelphi:
begin
FBackNavButtonShortCut := ShortCut(VK_LEFT, [ssAlt]);
FBackNavButtonShortCut2 := 0;
FForwardNavButtonShortCut := ShortCut(VK_RIGHT, [ssAlt]);
FForwardNavButtonShortCut2 := 0;
end;
kmtVisualStudio:
begin
FBackNavButtonShortCut := ShortCut(VK_OEM_MINUS, [ssCtrl]);
FBackNavButtonShortCut2 := ShortCut(VK_LEFT, [ssAlt]);
FForwardNavButtonShortCut := ShortCut(VK_OEM_MINUS, [ssCtrl, ssShift]);
FForwardNavButtonShortCut2 := ShortCut(VK_RIGHT, [ssAlt]);
FBackNavButtonShortCut2 := ShortCut(VK_OEM_MINUS, [ssCtrl]);
FForwardNavButtonShortCut2 := ShortCut(VK_OEM_MINUS, [ssCtrl, ssShift]);
end;
else
raise Exception.Create('Unknown FOptions.KeyMappingType');
Expand Down

0 comments on commit 3a5b2b9

Please sign in to comment.