Port-amiga archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Programming Question

On Sat, 8 Jun 1996, R T Dhami wrote:

> On Sat, 8 Jun 1996, Oldin' McGroin wrote:
> > On Fri, 7 Jun 1996, R T Dhami wrote:
> > 
> > > Hi,
> > > 
> > > I've been trying to accomplish this task:
> > > 
> > >   get a char (or int) from the keyboard without having to press
> > >   return after.  Every standard command like fgetc etc. all need
> > >   to have the return key pressed to continue.
> > > 
> > 
> > If I am correct (I am not sure), fgetc() is the unction needed, if you 
> > put it in a loop:
> Yeah, unfortunately the return key must be pressed.  I'm quite sure that
> there isn't any function in ANSI C or C++ to accomplish that task.  There
> is usually a OS independant function to accept one keystroke without
> waiting for the return key...  fgetc(), getc(), and similar commands in C
> and cin, cin.get() and similar commands in C++ all require the return key
> to be pressed, unfortunately.  I know that Borland C++ has a console
> function called getch() that does just what I want.  Anyone know of any
> console functions to get one character in NetBSD?  Maybe X has such a
> function...
> Rick

Okay, it is possibly impossible to do with one function (standard). Maybe 
it is possible to provide your own function? One which takes in a 
character an counts and when the count = 1 then we stop? This is the only 
other way I can think of to do this...I am sure that getch() is a 
standard function????


"Rub yourself up with deep-heat      |      The Intel-Outside page
 and stand next to a radiator!"      |  http://www.brad.ac.uk/~laguest
                             Ah! The asian child...
          Whats your nightmare? Being inbetween Steph and Begbie!!!

Home | Main Index | Thread Index | Old Index