program klavesy;

uses
  crt;

var
  znak: char;

const
  kl_ESC = #27;

begin
  clrscr;
  writeln('Konec: ESC');

  repeat
    write('Stisknete klavesu: ');
    znak := readkey;
    if ord(znak) in [30..255] then write(znak,' ');
    writeln(ord(znak));
  until znak = kl_ESC;
end.