home *** CD-ROM | disk | FTP | other *** search
- (*
- ╔═══════════════════════════════════════════════════════════════════════════╗
- ║ Turbo Pascal 6.0 Include File : SDKEY.INC ║
- ╟───────────────────────────────────────────────────────────────────────────╢
- ║ Program : SORTDEMO.PAS ║
- ╟───────────────────────────────────────────────────────────────────────────╢
- ║ Version : 1.0 ║
- ╟───────────────────────────────────────────────────────────────────────────╢
- ║ Copyright (c) 1992 by Jon S. Russell ║
- ╟───────────────────────────────────────────────────────────────────────────╢
- ║ Basic keyboard routines for SORTDEMO.PAS ║
- ╚═══════════════════════════════════════════════════════════════════════════╝
- *)
- procedure FlushKeyBuffer;
- var
- junk : char;
-
- begin (* FlushKeyBuffer *)
- repeat
- if KeyPressed then junk := ReadKey;
- until not KeyPressed;
- end; (* FlushKeyBuffer *)
-
- (*─────────────────────────────────────────────────────────────────────────*)
-
- procedure Wait;
- begin (* Wait *)
- repeat
- until KeyPressed;
- end; (* Wait *)
-
- (*─────────────────────────────────────────────────────────────────────────*)
-
- procedure FlushAndWait;
- begin (* FlushAndWait *)
- FlushKeyBuffer;
- Wait;
- end; (* FlushAndWait *)
-
- (*─────────────────────────────────────────────────────────────────────────*)
-
- procedure GetKey (var KeyRec : KeyRecType);
- begin (* GetKey *)
- KeyRec.Ch := readkey;
- if KeyRec.Ch <> #0
- then KeyRec.Extended := false
- else
- begin
- KeyRec.Extended := true;
- KeyRec.Ch := readkey;
- end;
- end; (* GetKey *)
-
- (*─────────────────────────────────────────────────────────────────────────*)
-