#include int key; int ever=TRUE; main () { initscr(); noecho(); /* timeout(-1);*/ notimeout(stdscr, TRUE); nonl(); cbreak(); keypad(stdscr, TRUE); for (;ever;) { /* key=getch();*/ switch (key=wgetch(stdscr)) { case KEY_UP: ever=!ever; break; case 'A': case 'a': fprintf(stderr, "\n##"); beep(); break; }; fprintf(stderr, "%0.2x ", key); } endwin(); }