Topic: [Script] Creating a shortcut key

Create a shortcut key on the example of Shift + Ctrl + P


procedure Form1_OnKeyDown (Sender: string; var Key: Word; Shift, Alt, Ctrl: boolean);
begin
     if (Key = ORD('P')) and Shift and Ctrl then
     begin
          ShowMessage('Shift + Ctrl + P');
     end;
end;


begin
     Form1.KeyPreview := True;
end.


Download project:
http://myvisualdatabase.com/forum/misc. … download=1

Dmitry.

Re: [Script] Creating a shortcut key

Hi

I am trying your program but it seems not to be working.
Can you please check it.

I wish to map a keyboard key such as F8 or Ctrl+A to open a form to add data.

Thank you

3 (edited by derek 2019-12-18 17:58:51)

Re: [Script] Creating a shortcut key

Hi George,
Not sure why Dmitry's example didn't work for you (it's good for me) but attached is an example with a few keys mapped to certain actions (I use CTRL+ALT to avoid any conflicts that you might get with just CTRL+ or with just ALT+ but the decision is yours). 
CTRL+ALT+H displays what short cut keys have been set up.
Derek.

Post's attachments

Attachment icon shortcutkey.zip 336.66 kb, 436 downloads since 2019-12-18