Solved

Press three keys together and trigger a function

Posted on 2016-10-12
3
55 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

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…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

785 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