ptccrtkeys.pas 638 B

123456789101112131415161718192021222324252627282930313233
  1. program ptccrtkeys;
  2. uses
  3. ptccrt, ptcgraph;
  4. var
  5. Gd, Gm: Integer;
  6. Ch, Ex: Char;
  7. Done: Boolean;
  8. begin
  9. Gd := VGA;
  10. Gm := VGAHi;
  11. InitGraph(Gd, Gm, '');
  12. Writeln('startup KeyMode (press ''m'' to switch): ', KeyMode);
  13. Done := False;
  14. repeat
  15. Ch := ReadKey;
  16. if Ch = #0 then
  17. Ex := ReadKey
  18. else
  19. Ex := #0;
  20. Writeln(Ord(Ch), ' ', Ord(Ex));
  21. if Ch = 'm' then
  22. begin
  23. if KeyMode <> High(KeyMode) then
  24. KeyMode := Succ(KeyMode)
  25. else
  26. KeyMode := Low(KeyMode);
  27. Writeln('KeyMode: ', KeyMode);
  28. end;
  29. if Ch = 'q' then
  30. Done := True;
  31. until Done;
  32. CloseGraph;
  33. end.