No Kbhit?

Is there any equivalant to kbhit() for porting simple terminal type apps???

Just wondering…

Pete Eddy

Pete Eddy <peter.w.eddy@lmco.com> wrote:

Is there any equivalant to kbhit() for porting simple terminal type apps???

I’m certain there is. kbhit() is a non-portable function, check your docs.
There is most definitely a POSIX or ANSI compliant equivalent, although for
those of us that have typically only worked on POSIX systems (and hence do
not have the kbhit() function) you’ll have to tell us what it does so that
we can tell you what the portable POSIX/ANSI equivalent would be.

Cheers,
Camz

Look at tcischars().
Cheers.

Eduard.
ed1k at ukr dot net

Pete Eddy <peter.w.eddy@lmco.com> wrote in article <adggs2$gmk$1@inn.qnx.com>…

Is there any equivalant to kbhit() for porting simple terminal type apps???

Just wondering…

Pete Eddy

Thanks, that looks like it should work.
Is there a POSIX equivalant?

Pete Eddy

“ed1k” <ed1k@spamerstrap.com> wrote in message
news:01c20b98$3c86d8c0$106fa8c0@ED1K…

Look at tcischars().
Cheers.

Eduard.
ed1k at ukr dot net

Pete Eddy <> peter.w.eddy@lmco.com> > wrote in article
adggs2$gmk$> 1@inn.qnx.com> >…
Is there any equivalant to kbhit() for porting simple terminal type
apps???

Just wondering…

Pete Eddy

Pete Eddy <peter.w.eddy@lmco.com> wrote:

Thanks, that looks like it should work.
Is there a POSIX equivalant?

I’m not sure there is a POSIX equivalent.

Probably the closest way to do it in a standard Unix manner
would be select() with a pointer to a timeval structure with
all times being 0. (This will effect a poll.)

-David

Pete Eddy

“ed1k” <> ed1k@spamerstrap.com> > wrote in message
news:01c20b98$3c86d8c0$106fa8c0@ED1K…
Look at tcischars().
Cheers.

Eduard.
ed1k at ukr dot net

Pete Eddy <> peter.w.eddy@lmco.com> > wrote in article
adggs2$gmk$> 1@inn.qnx.com> >…
Is there any equivalant to kbhit() for porting simple terminal type
apps???

Just wondering…

Pete Eddy
\


QNX Training Services
http://www.qnx.com/support/training/
Please followup in this newsgroup if you have further questions.