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 3.0 (C)Copyright Blaise Computing Inc. 1986
- *
- **/
-
- #include <bkeybd.h>
-
- int kbflush()
- {
- int num_found,scan;
- char ch;
-
- num_found = 0; /* None found yet. */
-
- while (kbready(&ch,&scan))
- {
- ++num_found; /* Found a waiting character. */
- kbin(&scan); /* Read and discard it. */
- }
-
- return num_found;
- }