Uses Crt;
Var Ch : Char;
Begin
ClrScr;
Ch:=#0;
Repeat
While KeyPressed do
Begin
Ch:=ReadKey;
GoToXY(15,1); Write(' ');
If Ch=#0 then
Begin
Ch:=ReadKey;
GoToXY(15,1); Write('#0');
End;
GoToXY(1,1); Write(Ch,' ');
GoToXY(10,1); Write(Ord(Ch),' ');
End;
Until Ch=#27; {выход по нажатию ESC}
End.