Beispiel #1
0
int vm_kbhit(void)
{
    KBDKEYINFO ki;
    ki.fbStatus = 0;
    KbdPeek(&ki, 0);
    return ki.fbStatus & KBDTRF_FINAL_CHAR_IN;
}
Beispiel #2
0
int
kbhit()
{
    KBDKEYINFO CharData;
    HKBD KbdHandle = 0;

    KbdPeek(&CharData, KbdHandle);
    return (CharData.fbStatus & (1 << 6));
}
Beispiel #3
0
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' */
}
Beispiel #4
0
/*
 * 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
}
Beispiel #5
0
_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
}
Beispiel #6
0
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

}
Beispiel #7
0
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, &regs, &regs);
        return !(regs.x.flags & 0x40);
    }
    else
    {
        KBDKEYINFO ki;
        ki.fbStatus = 0;
        KbdPeek(&ki, 0);
        return ki.fbStatus & KBDTRF_FINAL_CHAR_IN;
    }
}
Beispiel #8
0
USHORT __pascal KBDPEEK(KBDKEYINFO * pkbci, const HKBD hkbd)
{
  return KbdPeek(pkbci, hkbd);
}