procedure TForm1.OnKeyDown(Sender : TObject; var Key: Word; Shift: TShiftState); begin if Key = VK_F1 then ... end;