TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Chris Mcbrien
from: Vitus Jensen
date: 1994-08-05 01:21:28
subject: 32-bit Input

Chris Mcbrien wrote in a message to Vitus Jensen:

 CM> However, how do I retrieve just one character?  For example,
 CM> is the simple situation of "Press any key to continue".
 VJ> Check your documentation of DosDevIOCtl. Category 4, 
 VJ> Function 0x74 and 0x75 work find here.

 CM> I tried that.  No matter what I did, the DOSDEVIOCTL would
 CM> always return the Invalid Parameter error.  Care to post a
 CM> snippet of the code you used to make this work?

Oh, I retried it and DosDevIOCtl returned error 22! Rechecking the dox (I
WANT paper!), I realized that this IOCtl don't work in a PM window!

In case Fullscreen is OK for you:

int kbhit(HFILE h)
{
    USHORT para = 0;
    ULONG  para_len = sizeof(para);
    KBDKEYINFO  data;
    ULONG  data_len = sizeof(data);
    APIRET rc;

    rc = DosDevIOCtl( h, 4, 0x75,
            ¶, para_len, ¶_len,
            &data, data_len, &data_len );

    return para;
}

IOCtl 4/0x74: 
{
para = 1;
return (data.chChar ? : data.chChar : data.chScan&0x0100);
}

I also tried IOCtl 4/0x51 but it switches my keyboard to this binary mode
in the whole PM. Thank god, Ive got a mouse...


Tschuesz,
           Vitus

--- timEd/2 1.00


* Origin: Seems to be a Point of BetaBox Walheim (2:2474/100.20)
SEEN-BY: 12/2442 54/54 620/243 624/50 632/348 640/820 690/660 711/409 413 430
SEEN-BY: 711/807 808 809 934 942 712/353 623 713/888 800/1
@PATH: 2474/100 0 2476/2 2480/76 24/24 396/1 3615/50 229/2
@PATH: 12/2442 711/409 54/54 711/808 809 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.