ex3.pp 430 B

1234567891011121314151617181920212223
  1. Program Example3;
  2. uses Crt;
  3. { Program to demonstrate the ReadKey function. }
  4. var
  5. ch : char;
  6. begin
  7. writeln('Press Left/Right, Esc=Quit');
  8. repeat
  9. ch:=ReadKey;
  10. case ch of
  11. #0 : begin
  12. ch:=ReadKey; {Read ScanCode}
  13. case ch of
  14. #75 : WriteLn('Left');
  15. #77 : WriteLn('Right');
  16. end;
  17. end;
  18. #27 : WriteLn('ESC');
  19. end;
  20. until ch=#27 {Esc}
  21. end.