home *** CD-ROM | disk | FTP | other *** search
- /**
- *
- * Name KBWAIT -- Return a key sequence using polling.
- *
- * Synopsis key_pressed = kbwait(pfunction, pfunction_data);
- *
- * KEY_SEQUENCE key_pressed The returned character and
- * key code of the key sequence
- * pressed.
- * PKEY_CONTROL pfunction The address of the function
- * that is called between each
- * poll of the keyboard. 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 KBWAIT returns the next key sequence entered at the
- * keyboard using polling (KBPOLL). When a key sequence
- * is available, the key code and character code are
- * read and returned as a KEY_SEQUENCE structure.
- *
- * Since KBWAIT uses KBPOLL, the specified key control
- * function whose address is specified is called between
- * each poll of the keyboard. See KBPOLL for more
- * information on the key control function.
- *
- * Returns KEY_SEQUENCE key_sequence Character code & key code of
- * key pressed, or substitute
- * values supplied by the key
- * control function.
- *
- * Version 6.00 (C)Copyright Blaise Computing Inc. 1989
- *
- **/
- #include <bkeybrd.h>
-
- KEY_SEQUENCE kbwait(pfunction, pfunction_data)
- PKEY_CONTROL pfunction;
- void *pfunction_data;
- {
- KEY_SEQUENCE return_value;
-
- /* Loop until KBPOLL reports a keystroke has been found. */
- while (kbpoll(pfunction, pfunction_data, &return_value,
- KB_REMOVE_KEY) != KB_KEY_FOUND)
- ;
-
- return(return_value);
- }