I wrote this to show what the problem is :
So, pressing any key makes it's code appear on the screen. However, pressing the HOME or END keys exits the program at once. Pressing the ESC key also exits the program, but with a delay of about a second.Code:#include <ncurses.h> #define ESC 27 int main () { int x = 0; initscr (); keypad (stdscr, TRUE); cbreak (); while (x != ESC) { clear (); printw ("%d", x); x = getch (); } endwin (); return 0; }
What should I change to make it run right (ECS exits immediately, HOME/END prints the keycode)?
Thanks in advance.



LinkBack URL
About LinkBacks


