The kbhit function returns a non-zero value when there is an input character available in the keyboard buffer.
#include <conio.h> int kbhit(void);
Be careful when using this function since the calling thread will not sleep. Typcial use where the function is called repeatedly until a key is pressed will cause the thread to execute continuously. Consider using getche or getch instead.
A non-zero value indicates there there is data in th keyboard buffer. A zero value indicates there is no data in the keyboard buffer.
Versions | Defined in | Include | Link to |
---|---|---|---|
INtime 6.0 | intime/rt/include/conio.h | conio.h | clib.lib |