On Sat, 2003-08-02 at 02:19, Buz Davis wrote: > Sorry if this is as dumb as I feel, but I haven't been successful at > digging out > an answer. > > I would like a routine to read the keyboard and report the single key > pressed, > and give me control back without waiting for ENTER to be pressed. > Under MSDOS (where all of my c experience has been) there was a c > routine > called getch() that would do just this. I can't seem to find one under > Linux. > > I have tried calls to setvbuf specifying _IONBF, hoping that it would > alter the > workings of fgetc(stdin), but it didn't seem to help. I tried copying > the unbuffered > getchar routine (which uses read(0,&c,1)) from K&R, but it waits for me > to press > ENTER, too. The only success I've had involved guessing at how to use > Curses. > Unfortunately, although the man pages for individual curses routines > (like it's getch) > say 'see also curses(3x)' there apparently is no such page on my > system, so > I really don't know if I am misusing things or not. > (Second question: is there an overview of Curses available somewhere ?). > > Could somebody point me in the right direction ? >
you might want to read the infopage of (g)libc on Terminal Modes. But maybe it would be easier to take a look at ncurses (which i never had), I have heard there are a routines to dealt with those sort of problems. -- redhat-list mailing list unsubscribe mailto:[EMAIL PROTECTED] https://www.redhat.com/mailman/listinfo/redhat-list