Skip to content

[Linux] Modify the FileExit action to have CTRL-Q shortcut #2277

@gcarreno

Description

@gcarreno

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...

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementEnhances an existing featurelinux-nativeAffects Linux version (not Wine)

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions