I am trying to implement something similar to Notepad's insertion of the date and time when users press the F5 key. In the event
procedure TFormMain.Memo1KeyPress(Sender: TObject; var Key: Char);
the code
if Key=Chr(VK_F5) then
begin
Memo1.Lines.Add(FormatDateTime('h:nn',now));
end;
has no effect. In the same method,
if Key=Chr(VK_ESCAPE) then
//do something
does something.
What do I need to do for the application to recognize when users press F5?