#include int main (int argc, char ** argv) { int skip = 0; wint_t ch; bool done = FALSE; initscr(); noecho(); nodelay(stdscr, TRUE); keypad(stdscr, TRUE); while (!done) { move(0,0); switch(get_wch(&ch)) { case KEY_CODE_YES: skip = 0; mvprintw(0,0, "key: %s", keyname(ch)); break; case OK: skip = 0; done = (ch == 27); mvprintw(0,0, "chr: %s", key_name(ch)); break; case ERR: mvprintw(2,0, "skip %d", ++skip); break; } clrtoeol(); } endwin(); return 0; }