procedure TForm1.Edit1KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if (Shift=[ssAlt]) then Label1.Caption:='Alt'
else if (Shift=[ssShift]) then Label1.Caption:='Shift'
else if (Shift=[ssCtrl]) then Label1.Caption:='Ctrl'
else Label1.Caption:='';
Label2.Caption:=Chr(Key);
Label3.Caption:=IntToStr(Key);
end;
procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
Label2.Caption:=key;
if key=#13 then Label2.Caption:='Enter';
if key=#27 then Label2.Caption:='ESC';
if key=#20 then Label2.Caption:='Space';
Label3.Caption:=IntToStr(ord(key));
end;