Path: utzoo!utgpu!news-server.csri.toronto.edu!qucdn!boydj Organization: Queen's University at Kingston Date: Wednesday, 27 Mar 1991 22:29:15 EST From: Jeff Boyd Message-ID: <91086.222916BOYDJ@QUCDN.QueensU.CA> Newsgroups: comp.lang.pascal Subject: Re: CTRL-Characters Here's a quick program you can play around with. It was written under TP5.0 for a Zenith AT clone. After invoking it, simply press keys or combinations of keys and Alt, Ctrl, or Shift. This was a 5 minute hack, so comments on my coding style will be ignored :-). Execution stops after Alt-F10 (normal) or Ctrl-Break (abnormal). {======================================================================} program KeyTest (input,output) ; uses Crt ; var KeyStroke : char ; ExtendKey : boolean ; {======================================================================} begin {Main_Program} repeat KeyStroke := ReadKey ; if (KeyStroke<>#0) then begin ExtendKey := FALSE ; writeln ('ReadKey: ',KeyStroke,' ',ord(KeyStroke)) ; end else begin ExtendKey := TRUE ; KeyStroke := ReadKey ; writeln ('ReadKey: ',KeyStroke,' ','0;',ord(KeyStroke)) ; end ; until ((ExtendKey) and (KeyStroke=#113)) ; {* that's ALT-F10 to exit *} end . {Main_Program} {======================================================================}