home *** CD-ROM | disk | FTP | other *** search
- PROGRAM KeyDemo;
- {$C-}
- {
- Demonstration program for InKey function
-
- Source: "INKEY: A Multiple Keypress Function", TUG Lines Volume I Issue 4
- Author: Orville Jenkins/Panther Associates/Dallas-Ft.Worth,Texas/
- Application: MS-DOS, PC-DOS
- }
-
- var
- specialkey : boolean;
- command : char;
-
- {$I INKEY.INC}
-
- begin
- clrscr;
- writeln('INKEY DEMO - Press any key - Press F10 to quit');
- writeln;
- command := #00;
-
- repeat
- if inkey(specialkey,command)
- then
- begin { Tell caller the value of the key }
- if specialkey
- then writeln('That''s a SPECIAL key - the ascii code is ',ord(command))
- else writeln('That''s a REGULAR key - the ascii code is ',ord(command));
- writeln;
- if command <> #68
- then writeln('INKEY DEMO - Press any key - Press F10 to quit');
- writeln;
- end;
- until command = #68; { That is, the F10 key }
- end. {Program KeyDemo}