Solved

Short Keys

Posted on 2002-07-16
6
202 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Suggested Courses
Course of the Month3 days, 17 hours left to enroll

630 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