-
-
Notifications
You must be signed in to change notification settings - Fork 563
[Linux] Modify the FileExit action to have CTRL-Q shortcut #2277
Copy link
Copy link
Closed
Labels
enhancementEnhances an existing featureEnhances an existing featurekeyboardAffects usage with keyboard or shortcutsAffects usage with keyboard or shortcutslinuxAffects Linux version (not Wine)Affects Linux version (not Wine)
Milestone
Description
Describe the solution you'd like
In Linuxland the usual caption for the FileExit custom action is &Quit and the shortcut is CTRL+Q.
Additional context
In my own applications I usually have:
uses
LCLType; // For VK_* constants, or KeyToShortCut, can never remember!!
procedure Form1.InitShortCuts;
begin
{$IFDEF UNIX}
actFileExit.ShortCut := KeyToShortCut(VK_Q, [ssCtrl]);
{$ENDIF}
{$IFDEF WINDOWS}
actFileExit.ShortCut := KeyToShortCut(VK_X, [ssAlt]);
{$ENDIF}
end;So, something like this:
uses
LCLType; // For VK_* constants, or KeyToShortCut, can never remember!!
procedure Form1.FormCreate;
being
{...}
InitShortCuts;
{...}
end;
procedure Form1.InitShortCuts;
begin
{$IFDEF UNIX}
actFileExit.Caption := '&Quit';
actFileExit.ShortCut := KeyToShortCut(VK_Q, [ssCtrl]);
{$ENDIF}
{$IFDEF WINDOWS}
actFileExit.Caption := 'E&xit';
actFileExit.ShortCut := KeyToShortCut(VK_F4, [ssAlt]);
{$ENDIF}
end;Should do the trick. I guess...
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementEnhances an existing featureEnhances an existing featurekeyboardAffects usage with keyboard or shortcutsAffects usage with keyboard or shortcutslinuxAffects Linux version (not Wine)Affects Linux version (not Wine)