kbhit

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.

Library:LibC
Classification:Novell
Service:Screen Support

Syntax

  #include <screen.h> 
   
  int kbhit ( void );
  

Return Values

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:

Decimal

Constant

Description

19

EWRNGKND

The wrong kind of operation is being attempted on the wrong kind of object.

23

ENO_SCRNS

Screen I/O is being attempted when no screen is available.

105

ENOCONTEXT

No thread context is present.

Remarks

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.

See Also