Topic: Enter key not recognised.

I am using MVD v6.3 and I'm trying to capture the 'enter' key in an OnKeyPress event.

Neither VK_RETURN or #13 is recognised, which I find very strange. In fact for either of the previous only the backspace key is recognised.  Incidentally the VK_BACKSPACE constant is not in MVD but #8 is.

procedure receiveOrder_tgReceiveOrder_OnKeyPress (Sender: TObject; var Key: Char);
begin
   if (Key) = #13 then   // alternative code,  if ord(key) = VK_RETURN;
   begin
     Key := #0;
     showmessage('I am in the key trap ' + Key);
     receiveOrder.tgReceiveOrder.dbUpdate;
   end;
   showmessage('key ' + Key);

I have tried two different keyboards and both have all keys recognised apart from the enter key.  I'm using W10 and the language is UK English and US keyboard layout.

Anyone else find they can't trap the enter key?

On a clear disk you can seek forever

Re: Enter key not recognised.

I have solved the problem, I realised that to trap the 'control' keys you have to use either OnKeyUP or OnKeyDown!

On a clear disk you can seek forever