Tests whether a keystroke is currently available from the keyboard of the application screen as long as the application screen is not identical to the System Console or System Logger screen.
#include <screen.h> int kbhit ( void );
Returns 0 when a keystroke is available. Returns 1 if no keystrokes are available. Returns -1 when an error occurs and sets errno to one of the following:
When a keystroke is available, you can call getch or getche to obtain the keystroke. With a stand-alone program, you can call kbhit continuously until a keystroke is available.