home *** CD-ROM | disk | FTP | other *** search
- /**
- *
- * Name KBFLUSH -- Discard all keystrokes waiting in the
- * keyboard buffer.
- *
- * Synopsis num_found = kbflush();
- *
- * int num_found Number of waiting keystrokes discarded.
- *
- * Description This function discards and clears all keystrokes waiting
- * in the BIOS type-ahead buffer.
- *
- * Returns num_found Number of waiting keystrokes discarded.
- *
- * Version 5.00 (C)Copyright Blaise Computing Inc. 1986,1987,1989
- *
- **/
-
-
- #include <bkeybrd.h>
-
-
- int kbflush()
- {
- int num_found, scan;
- char ch;
-
- num_found = 0; /* None found yet. */
-
- while (kbready (&ch, &scan) != 0)
- {
- ++num_found; /* Found a waiting character. */
- (void) kbgetkey (&scan); /* Read and discard it. */
- }
-
- return (num_found);
- }