🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.ibm.pc.misc
Article #6676

Re: help! dos(?) is grabbing half my alt keys

#6676
From: John Stanley
Date: Tue, 08 Jan 1991 17:01
34 lines
1485 bytes
rg@msel.unh.edu (Roger Gonzalez) writes:

> In Turbo C++ version 1.0:
> 
> #include <conio.h>
> #include <stdio.h>
> main()
> {
>     int c, done;
> 
>     done = 0;
>     printf("Hit a key, <esc> to quit\n");
>     while (!done) {
>         c = getch();
>         printf("keyboard scan code 0x%02x\n", c);
>         if (c == 27)
>             done = 1;
>     }
> }
> 
> Simple, right?
> 
> Why is it that the second half of the 2 byte sequence transmitted by
> certain alt keys sometimes gets absorbed and used by DOS?  For example,
> <alt>R transmits the sequence 0x00 0x13.  Every now and then, the output
> will get hung as if the 0x13 (which is ^S) was typed:
> keyboard sc

   You are probably getting caught by the I/O statement (printf) letting
DOS look at the keys, or by TurboC looking. The TurboC docs say something
about control-C checking occuring during I/O.

   Try doing an immediate second getch() if the first getch() returns 0.
Technical Details
Message-ID: <y5sgV1w163w@phoenix.com>
Path: arc1-ca.pugleaf.net!utzoo!censor!geac!torsqnt!lethe!yunexus!ists!helios.physics.utoronto.ca!news-server.csri.toronto.edu!cs.utexas.edu!usc!wuarchive!udel!haven!adm!cmcl2!uupsi!fozzie!stanley
References: <1991Jan7.230518.25949@uunet!unhd>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!censor!geac!torsqnt!lethe!yunexus!ists!helios.physics.utoronto.ca!news-server.csri.toronto.edu!cs.utexas.edu!usc!wuarchive!udel!haven!adm!cmcl2!uupsi!fozzie!stanley
From: stanley@phoenix.com (John Stanley)
Newsgroups: comp.sys.ibm.pc.misc,comp.os.msdos.programmer
Subject: Re: help!  dos(?) is grabbing half my alt keys
Message-ID: <y5sgV1w163w@phoenix.com>
Date: 8 Jan 91 17:01:21 GMT
References: <1991Jan7.230518.25949@uunet!unhd>
Organization: Not BIFF At All (NBAA)
Lines: 34