getch /getc/getchar

getch /getc/getchar

Post by news » Fri, 07 May 1999 04:00:00



Does N E 1 know how to get a singel char from the keyborad
using generic C ( simple C ) without using ncurses.h or vga.h
 
 
 

getch /getc/getchar

Post by Duncan Simps » Fri, 07 May 1999 04:00:00



Quote:>Does N E 1 know how to get a singel char from the keyborad
>using generic C ( simple C ) without using ncurses.h or vga.h

Yup.

Just twidle the keyboard's state out of cooked mode. Nice programs
will return the keyboard to the state they found it when they have
finished or get halted by job control. To do this restore the original
settings when to get SIGTSTP and change them back again when you get
SIGCONT).

This is portable across all known unicies and POSIX includes cooked,
rare and raw keyboard modes.

Duncan (-:

--
Duncan (-:
"software industry, the: unique industry where selling substandard goods is
legal and you can charge extra for fixing the problems."