non blocking loop with getch

Help
Anonymous
2003-10-22
2013-04-25
  • Anonymous - 2003-10-22

    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 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
    thanks in advance
    V.

     
    • elsapo

      elsapo - 2005-06-26

      I just reproduced this bug against the current cvs trunk as well.

       

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks