int vm_kbhit(void) { KBDKEYINFO ki; ki.fbStatus = 0; KbdPeek(&ki, 0); return ki.fbStatus & KBDTRF_FINAL_CHAR_IN; }
int kbhit() { KBDKEYINFO CharData; HKBD KbdHandle = 0; KbdPeek(&CharData, KbdHandle); return (CharData.fbStatus & (1 << 6)); }
int fast_kbhit_os2(void) { extern KBDKEYINFO ki; /* defined in ISSHIFT.C */ KbdPeek(&ki, 0); /* peek in the keyboard buffer */ DosSleep(1); /* give up the rest of the time slice */ return (ki.fbStatus & (1 << 6)); /* only return true if key is 'final' */ }
/* * Check for the presence of a keyboard character. * Return TRUE if a key is already in the queue. */ int ttstat() { #if 0 KBDKEYINFO kinfo; return (KbdPeek(&kinfo,0) == 0); #else return 0; #endif }
_WCRTLINK int kbhit( void ) { KBDKEYINFO info; if( _RWD_cbyte != 0 ) return( 1 ); #ifdef DEFAULT_WINDOWING if( _WindowsKbhit != NULL ) { // Default windowing LPWDATA res; res = _WindowsIsWindowedHandle( (int) STDIN_FILENO ); return( _WindowsKbhit( res ) ); } #endif #if defined(__OS2_286__) if( _RWD_osmode == DOS_MODE ) { return( _os_kbhit() ); } KbdPeek( &info, 0 ); return( ( info.fbStatus & 0xe0 ) != 0 ); #else KbdPeek( &info, 0 ); return( ( info.fbStatus & 0xe0 ) != 0 ); #endif }
int be_kbhit (void) { #ifdef MSWIN return kbhit(); #endif #ifdef OS2 KBDKEYINFOk; return KbdPeek(&k, NULLHANDLE) == 0 && (k.fbStatus & KBDTRF_FINAL_CHAR_IN); #endif #if !defined(MSWIN) && !defined(OS2) return 0; #endif }
int vm_kbhit(void) { if (_osmode == DOS_MODE) { union REGS regs; static unsigned short counter = 0; if (counter % 10 == 0) { opsysTimeSlice(); } counter++; regs.h.ah = 0x01; _int86(0x16, ®s, ®s); return !(regs.x.flags & 0x40); } else { KBDKEYINFO ki; ki.fbStatus = 0; KbdPeek(&ki, 0); return ki.fbStatus & KBDTRF_FINAL_CHAR_IN; } }
USHORT __pascal KBDPEEK(KBDKEYINFO * pkbci, const HKBD hkbd) { return KbdPeek(pkbci, hkbd); }