Solved

Short Keys

Posted on 2002-07-16
6
198 Views
Last Modified: 2010-04-04
In My apllication i would like to invoke the mouse click events from the keyboard through different short keys
ie to assign different onclick events of controls to keyboard also with shifting the focus to it
whats the best way of doing this
with regards
tct
0
Comment
Question by:palabros
  • 4
  • 2
6 Comments
 
LVL 17

Expert Comment

by:geobul
ID: 7158882
Hi,
Drop a TActionList component on your form, double-click on it to open the actions editor, add few actions, assign ShortCuts (ShortCut property) to them and write appropriate OnExecute events.

Regards, Geo
0
 
LVL 17

Expert Comment

by:geobul
ID: 7158889
Example:

type
  TForm1 = class(TForm)
    ActionList1: TActionList;
    Action1: TAction;
    Edit1: TEdit;
    Memo1: TMemo;
    Button1: TButton;
    procedure Action1Execute(Sender: TObject);
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.Action1Execute(Sender: TObject);
begin
  Button1.SetFocus;
  Button1Click(Sender);
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  ShowMessage('Button1 was pressed');
end;
0
 

Author Comment

by:palabros
ID: 7159416
i think my question is not clear.
i have an apllication in which there some buttons ,doubleclick events on grid etc . i would like to invoke these events on keyboard shortkeys like shift+v or something of that sort
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 17

Accepted Solution

by:
geobul earned 100 total points
ID: 7159445
That's what I'm talking about. In my example above there are some controls on a form and Button1 is one of them. It has its own OnClick event named Button1Click. Action1 from ActionList1 has ShortCut property set to Ctrl-V and OnExecute event which changes the focus to Button1 and fires its OnClick event. It doesn't matter where the focus currently is. It can be on a memo or edit control.

Shift-V is an alphanumeric key (capital v for example) and therefore can't be used as a shortkey.

Regards, Geo
0
 

Author Comment

by:palabros
ID: 7164523
Thanks a lot. it worked fine
0
 
LVL 17

Expert Comment

by:geobul
ID: 7164549
You're welcome. I'm glad that it helped you :-)
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Windows Drag & Drop Location 2 100
Delphi cmd execution 6 60
Delphi - replicating a form 8 74
URL for downloading Google Chrome for Win XP 2 154
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question