Esempio n. 1
0
trap_retval ReqRead_user_keyboard( void )
{
    read_user_keyboard_req      *acc;
    read_user_keyboard_ret      *ret;

    acc = GetInPtr( 0 );
    ret = GetOutPtr( 0 );
    ret->key = 0;
    if( acc->wait != 0 ) {
        unsigned long   end_time;
        unsigned long   *cur_time;

        cur_time = MK_FP( 0x40, 0x6c ); /* set up pointer to the BIOS clock */
        end_time = *cur_time + ( acc->wait * 18 );
        for( ;; ) {
            if( KeyWaiting() == 0 ) {
                break;
            } else  if( end_time <= *cur_time ) {
                return( sizeof( *ret ) );
            }
        }
    }
    ret->key = GtKey();
    return( sizeof( *ret ) );
}
Esempio n. 2
0
static unsigned_16 AccReadUserKey()
{
    rd_key_return FAR *retblk;

    retblk = GetOutPtr( 0 );
    retblk->key = GtKey();
    return( sizeof( rd_key_return ) );
}