Koenraad Lelong wrote: 
  Hi, 
  I would like to make my application respond to function keys. How can I do 
that ? 
  I tried the form's KeyPres-event, with Keypreview on, with no result. 
  Thanks for any help. 
  Regards, 
  Koenraad Lelong. 

  _________________________________________________________________ 
      To unsubscribe: mail [EMAIL PROTECTED] with 
                 "unsubscribe" as the Subject 
    archives at http://www.lazarus.freepascal.org/mailarchives 


try this:
procedure TForm1.FormCreate(Sender: TObject);
begin
  Application.AddOnKeyDownBeforeHandler(@MyKeyDown);
end;

procedure TForm1.MyKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
begin
  if ((Shift = []) and (Key = VK_F10)) then begin
     ShowMessage('F10 has been pressed');
     Key:=VK_UNKNOWN;
  end;
end;

Regards,
Salvatore

Reply via email to