home *** CD-ROM | disk | FTP | other *** search
- /**
- *
- * Name KBKCFLSH -- Call the key control procedure to flush
- * the keyboard buffer.
- *
- * Synopsis kbkcflsh(pfunction, pfunction_data);
- *
- * PKEY_CONTROL pfunction The address of the function
- * that is called to flush the
- * keyboard buffer. It must
- * have a single parameter of
- * type KB_DATA *. This function
- * is called the key control
- * function.
- * void *pfunction_data The address of an information
- * record to be passed to the key
- * control function.
- *
- * Description KBKCFLSH calls the key control procedure to flush
- * the keyboard buffer. This is accomplished by setting
- * the control_action field of the KB_DATA structure to
- * KB_FLUSH. See KBPOLL for more information on the key
- * control function.
- *
- * If the key control function is NIL, KBKCFLSH calls
- * KBFLUSH to flush the keyboard buffer.
- *
- * Returns nothing.
- *
- * Version 6.00 (C)Copyright Blaise Computing Inc. 1989
- *
- **/
- #include <bkeybrd.h>
-
- void kbkcflsh(pfunction, pfunction_data)
- PKEY_CONTROL pfunction;
- void *pfunction_data;
- {
- KB_DATA key_control_data;
-
- if (pfunction == 0)
- {
- kbflush();
- return;
- }
-
- key_control_data.key_seq.character_code = 0;
- key_control_data.key_seq.key_code = 0;
- key_control_data.pfunction_data = pfunction_data;
- key_control_data.control_action = KB_FLUSH;
- key_control_data.key_found = KB_NO_KEY_FOUND;
- key_control_data.returned_action = KB_FLUSH;
-
- pfunction(&key_control_data);
-
- if (key_control_data.returned_action == KB_FLUSH)
- kbflush();
-
- return;
- }