Jump to content
Sign in to follow this  
CoeurdeLeon

Actionlist shortcuts do not work

Recommended Posts

I am using Delphi 12.2.  I am using a TActionList in a datamodule.  I have assigned shortcuts to most of the actions.  None of them work.

 

Any ideas what could be wrong?

 

Thank you.

Richard Maley

Share this post


Link to post

I added an actionlist to my main form and created Action1 with 

procedure TfrmWebsocketClient.Action1Execute(Sender: TObject);
begin
  Showmessage('Hello World');
end;
as its Execute method.

 

Action1 had a shortcut of Ctrl+F5.

 

IT WORKED.

 

It must have something to do with my having the actionlist in a datamodule.

 

Additionally, The datamodule has a strange line in it:

{%CLASSGROUP 'Vcl.Controls.TControl' }

 

Why is that there?

 

Still looking for answers.

 

 

 

Share this post


Link to post

While TApplication checks IsShortCut for the main form only, each form also checks IsShortCut for all its child components (direct and indirect).

 

Your options to get the TActionList on the datamodule executed is either make the datamodule owned by the mainform or wire the OnShortCut event handler of TApplication and call the actionlist IsShortCut manually.

  • Like 1

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×