static void finish(int sig)
{
/* do your non-curses wrapup here */
endwin();
exit(0);
}
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 /
for (;
{
int c;
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.
static void finish(int sig)
{
/* do your non-curses wrapup here */
endwin();
exit(0);
}
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 */
for (;
{
int c;
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.
For now I can’t ;-( , this is hook up with program that has a bunch of
printf.
Plus in the futur I don’t think I can get everyone to not ever
use printf. I’m sure some one will come to me and say,
hey my printf is doing weird stuff…
static void finish(int sig)
{
/* do your non-curses wrapup here */
endwin();
exit(0);
}
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 */
for (;
{
int c;
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.
For now I can’t ;-( , this is hook up with program that has a bunch of
printf.
Plus in the futur I don’t think I can get everyone to not ever
use printf. I’m sure some one will come to me and say,
hey my printf is doing weird stuff…
I agree with Ken that if you start initscr(), you supposed to using
ncurses library functions to update screen.
The initscr() of ncurses lib, will clear these flags:
static void finish(int sig)
{
/* do your non-curses wrapup here */
endwin();
exit(0);
}
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 */
for (;
{
int c;
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.
I don’t understand. You are going to link with other programs which are using
printf’s? Then you will process or format these?
Mario Charest wrote:
For now I can’t ;-( , this is hook up with program that has a bunch of
printf.
Plus in the futur I don’t think I can get everyone to not ever
use printf. I’m sure some one will come to me and say,
hey my printf is doing weird stuff…
static void finish(int sig)
{
/* do your non-curses wrapup here */
endwin();
exit(0);
}
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 */
for (;
{
int c;
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.
static void finish(int sig)
{
/* do your non-curses wrapup here */
endwin();
exit(0);
}
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 */
for (;
{
int c;
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.
For now I can’t ;-( , this is hook up with program that has a bunch of
printf.
Plus in the futur I don’t think I can get everyone to not ever
use printf. I’m sure some one will come to me and say,
hey my printf is doing weird stuff…
I agree with Ken that if you start initscr(), you supposed to using
ncurses library functions to update screen.
The initscr() of ncurses lib, will clear these flags:
static void finish(int sig)
{
/* do your non-curses wrapup here */
endwin();
exit(0);
}
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 */
for (;
{
int c;
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.
I’m not sure if it is possible to do what you want. Ask on the ncurses bug
e-mail list at bug-ncurses@gnu.org and Thomas Dickey (the maintainer of
ncurses) may have some advice. Also the latest version is 5.1 but that is not
ported to QNX yet.
static void finish(int sig)
{
/* do your non-curses wrapup here */
endwin();
exit(0);
}
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 */
for (;
{
int c;
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.
I’m not sure if it is possible to do what you want. Ask on the ncurses bug
e-mail list at > bug-ncurses@gnu.org > and Thomas Dickey (the maintainer of
ncurses) may have some advice. Also the latest version is 5.1 but that is not
ported to QNX yet.
For now I can’t ;-( , this is hook up with program that has a bunch of
printf.
Plus in the futur I don’t think I can get everyone to not ever
use printf. I’m sure some one will come to me and say,
hey my printf is doing weird stuff…
I agree with Ken that if you start initscr(), you supposed to using
ncurses library functions to update screen.
The initscr() of ncurses lib, will clear these flags:
I’m not sure how “robust” this solution is. I would have rather
use some low level ncurse function to do the input translation,
but I’ve spend enough time on this already ;-(