
Click above to get retro games delivered to your door ever month!
X-Hacker.org- libc - <b>kbhit</b>
[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
kbhit
=====
Syntax
------
#include <pc.h>
int kbhit(void);
Description
-----------
If the user has hit a key, this function will detect it. This function
is very fast when there is no key waiting, so it may be used inside
loops as needed.
If you test shift/alt/ctrl status with bios calls (e.g., using `bioskey
(2)' or `bioskey (0x12)') then you should also use bios calls for
testing for keys. This can be done with by `bioskey (1)' or `bioskey
(0x11)'. Failing to do so can cause trouble in multitasking
environments like DESQview/X.
Return Value
------------
Nonzero if a key has been hit, else zero.
Example
-------
while (!kbhit())
do_stuff();
Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson