procedure TForm1.WMKeyDown(var Msg: TWMKey);
var
st: array[0..63] of char;
sc: integer;
kd: Longint;
begin
inherited DoKeyDown(Msg);
sc:=MapVirtualKey(Msg.CharCode, 0);
kd:=Longint(sc) shl 16;
if (Msg.KeyData and $1000000)<>0 then begin
kd:=kd+$1000000;
end;
if (sc=0) or (GetKeyNameText(kd, @st, 64)=0) then begin
Label1.Caption:='';
end else begin
Label1.Caption:=st;
end;
end;