Re: WOT: Testing stdin

New Message Reply Date view Thread view Subject view Author view

Thom DeCarlo (trdecarlo++at++tasc.com)
Thu, 24 Jun 1999 10:48:43 -0400


Hi All,
Thanks for all your help. Murray's suggestion of _kbhit() got me the closest. But it
looks like I need to provide one more piece of information.
This application is forked by a web-servlet application and will be getting its
control information from that app via stdin. Therefore, there will not be any
keyboard events to check.
One of my colleagues suggested I spawn off a thread to handle the IO functions.
Sounds like a lot of work for very little return to me.

Thom

"Murray G. Gamble" wrote:

> Hi All (Thom),
>
> If you're working on NT, you can test _kbhit() in your main loop to check
> for input at the console (ref. "conio.h") and _getch() to determine which
> key was pressed.
> I use it like so:
>
> // check for console input
> if (_kbhit())
> {
> switch (_getch())
> {
> case 'q': // exit
> case 'Q':
> done = true;
> break;
> etc....
> }
> }
>
> 'Hope this helps!
>
> Mur.
>
> >
> > Well, I guess I have to admit it. I'm not writing this on an SGI. I'm on
> WinNT
> > using VC++ 6.0 and VegaNT.
> >
> > I can't find anything on this machine that defines the select() function.
> And
> > the read() function still blocks until '\n' is entered. I did find an
> > _filelength() function which I thought might work, but it just returns an
> > error whether anything is on the input buffer or not.
> >
> > Thom
> >
> >
> >


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Thu Jun 24 1999 - 07:42:35 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.