Newsgroups: comp.speech
Path: cantaloupe.srv.cs.cmu.edu!rochester!udel!news.mathworks.com!news.duke.edu!convex!cs.utexas.edu!swrinde!pipex!bt!btnet!uknet!festival!leeds.ac.uk!news
From: een6njb@sun.leeds.ac.uk (N J Bailey)
Subject: Re: Help: I need to exit an infinite loop w
Message-ID: <1995Mar1.174611.14998@leeds.ac.uk>
Reply-To: een6njb@sun.leeds.ac.uk
Organization: University of Leeds, U.K.
Date: Wed, 1 Mar 1995 17:46:11 +0000 (GMT)
References: <3ieh96$7so@granite.sentex.net>
Lines: 27

In article 7so@granite.sentex.net, peter@engcorp.com (Peter Hansen) writes:
> In <userid.2.2F490638@psu.edu>, userid@psu.edu (Firstname I. Lastname)
> writes:
> >    I am writing a speech recognition program in 'C' and I need to stay in a
> >continueous loop until a key is pressed.
> >
> >    I tried using the !kbhit command but had some problems (Do I need to flush
> >the buffers first?).
> 
> This is hardly the appropriate newsgroup for this queston.
> Nevertheless, the answer is yes, flush the buffers and kbhit() will work
> fine.
> 


What is this kbhit() which you mention?

Don't you just do an ioctl() to put the terminal in raw mode???

Or else, catch the SIGINT signal and use the break key to set a flag,
then do a while(!flag) loop.  (That's how I did it...)

Sorry, I know this should be in the C group, but you did ask.

Nick.


