Capture your own 'hotkeys' in a form  

Send By: Q3 Team
Web : www.q3.nu
Email: dlib@q3.nu
Date: 08/12/99

Tip accessed 671 times

 


First: set the form's KeyPreview := true

Then, you do something like this:


      procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;
        Shift: TShiftState);
      begin
        if (ssCtrl in Shift) and (chr(Key) in ['A', 'a']) then
          ShowMessage('Ctrl-A');
      end;



In the example, we capture Ctrl-A