I want to handle keyboard through terminfo database.
static void finish(int sig)
/* do your non-curses wrapup here */
main(int argc, char argv)
/ initialize your non-curses data structures here /
(void) initscr(); / initialize the curses library /
keypad(stdscr, TRUE); / enable keyboard mapping /
(void) nonl(); / tell curses not to do NL->CR/NL on output /
(void) cbreak(); / take input chars one at a time, no wait for \n
(void) noecho(); / don’t echo input /
c = getch(); / refresh, accept single keystroke of input */
printf(“c = %d\n”, c );
finish(0); /* we’re done */
In the following code almost everything works expect the printf.
It’s not flushed. I have to fflush(stdout).
I have tried to turn on/off every terminal device flag I could
thing of with no success.
Anyone with a suggestion?