home *** CD-ROM | disk | FTP | other *** search
- {@@@@@@@@@@@ copyright (C) 1984 by Neil J. Rubenking @@@@@@@@@@@@@@@@@@@@@@@@
- The purchaser of these procedures and functions may include them in COMPILED
- programs freely, but may not sell or give away the source text.
-
-
- DRIVER for procedure GETKEYS(chr1,chr2)
-
- Waits until a key is pressed, then returns ASCII char in chr1 and chr(0) in
- chr2 for standard ASCII characters, or chr(27) in chr1 and a code character
- in chr2 if an "escape sequence" character. See KEYCHART.DAT for translation.
- NOTE that BACKSPACE and RETURN are not visible except by their activity--
- they still function!
-
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
- program GETKEYS;
-
- {$I getkeys.lib}
- var
- chr1, chr2 : char;
- begin
- WriteLn('Press various keys. Press <ESC> to quit.');
- repeat
- GetKeys(chr1,chr2);
- if chr1 <> #27 then
- WriteLn('Normal character ',chr1)
- else
- if chr2 <> #0 then
- WriteLn('Special character ',chr2);
- until (chr1 = #27) and (chr2 = #0); {press ESC to get out of loop}
- end.