Uses CRT;
Var
  c: Char;
  w,w1: Word;
Begin
  WriteLn('Нажимайте кнопки, конец 2 раза Esc');
  repeat
   w1 := w;
   c:=readkey;
   if c = #0 then w := ord(readkey)
   else w := ord(c);
   WriteLn(w);
  until (w = 27) and (w1 = 27);
End.
