vitellozzo
Programmer
Hello
I've recently used pdcurses to port a dos program under win2k, using vc++ 6.
In my program there is while loop, which must continue (non blocking keyboard read)until the escape character is pressed.
The problem is that i must press it twice to stop the loop and if i press other buttons (before esc)there is a longer delay.
The code is:
... var,def,etc
initscr();
noecho();
cbreak();
nodelay(stdscr,TRUE);
if(has_colors()==FALSE)
{...}
start_color();
init_pair(1,COLOR_WHITE,COLOR_BLUE);
attron(COLOR_PAIR(1));
bkgd(COLOR_PAIR(1));
clear();
....other c code
refresh();
.... other c code
do
{
...other c code plus various refreshes and mvprintw
}while(getch()!=27);
if i put while(getch()==ERR) and press two buttons simultanousely the application exit correctly.
I prefer don't use kbhit() because other libraries conflict with conio.h (and i must use them )
thanks in advance
V.
I've recently used pdcurses to port a dos program under win2k, using vc++ 6.
In my program there is while loop, which must continue (non blocking keyboard read)until the escape character is pressed.
The problem is that i must press it twice to stop the loop and if i press other buttons (before esc)there is a longer delay.
The code is:
... var,def,etc
initscr();
noecho();
cbreak();
nodelay(stdscr,TRUE);
if(has_colors()==FALSE)
{...}
start_color();
init_pair(1,COLOR_WHITE,COLOR_BLUE);
attron(COLOR_PAIR(1));
bkgd(COLOR_PAIR(1));
clear();
....other c code
refresh();
.... other c code
do
{
...other c code plus various refreshes and mvprintw
}while(getch()!=27);
if i put while(getch()==ERR) and press two buttons simultanousely the application exit correctly.
I prefer don't use kbhit() because other libraries conflict with conio.h (and i must use them )
thanks in advance
V.