Solved

Short Keys

Posted on 2002-07-16
6
199 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
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
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…

856 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