// Hiermit kann man die beiden ENTER-Tasten unterscheiden.


// Getestet mit RS 10.4 unter Win10
 ... 
 private 
    { Private-Deklarationen } 
  public 
    { Public-Deklarationen } 
    procedure WMKeyUp(var Message: TWMKeyUp); message WM_KEYUP; 
    procedure WMKeyDown(var Message: TWMKeyDown); message WM_KEYDOWN; 
  end; 
 
var 
  Form1: TForm1; 
 
implementation 
 
{$R *.dfm} 
 
const 
  prf = 16777216; 
 
procedure TForm1.WMKeyDown(var Message: TWMKeyDown); 
begin 
  if Message.CharCode <> VK_RETURN then 
  begin 
    inherited; 
    Exit; 
  end; 
  if (prf and Message.KeyData) <> 0 then 
    Label1.Caption := 'Keypad Enter pressed' 
  else 
    Label1.Caption := 'Return pressed'; 
end; 
 
procedure TForm1.WMKeyUp(var Message: TWMKeyUp); 
begin 
  if Message.CharCode <> VK_RETURN then 
  begin 
    inherited; 
    Exit; 
  end; 
  if (prf and Message.KeyData) <> 0 then 
    Label1.Caption := 'Keypad Enter released' 
  else 
    Label1.Caption := 'Return released'; 
end;
Zugriffe seit 6.9.2001 auf Delphi-Ecke