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, 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




Home | Main Index | Thread Index | Old Index