Solved

Press three keys together and trigger a function

Posted on 2016-10-12
3
50 Views
Last Modified: 2016-10-12
Hello,

I want to combine three keys together CTRL + ALT + F12 and shoot a message with ShowMessage('OK')

how can I do this in my form?

Thanks
Alex
0
Comment
Question by:hidrau
3 Comments
 
LVL 22

Accepted Solution

by:
Ferruccio Accalai earned 250 total points
ID: 41840137
procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
begin
If (key = vk_F12) and (ssCtrl in Shift) and (ssAlt in Shift) then ShowMessage('OK');
end;

Open in new window

0
 
LVL 37

Assisted Solution

by:Geert Gruwez
Geert Gruwez earned 250 total points
ID: 41840678
that's assuming keypreview is true on your form ...

and some other app has not registered this shortcut key with windows RegisterHotKey
otherwise your app will not get the key

here is such an approach
http://www.delphitips.net/2007/04/01/global-system-hotkey/
0
 
LVL 1

Author Closing Comment

by:hidrau
ID: 41840768
thanks a lot
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
loading dll from external path 1 211
Delphi XE10, MySQL Query 4 126
Delphi : could not find program, '...exe' 2 147
select query - oracle 16 92
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…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

911 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now