home *** CD-ROM | disk | FTP | other *** search
/ ftp.muug.mb.ca / 2014.06.ftp.muug.mb.ca.tar / ftp.muug.mb.ca / pub / src / linux / old-src / ncurses-1.8.5 / getch.c < prev    next >
C/C++ Source or Header  |  1993-11-27  |  249b  |  25 lines

  1.  
  2. #include <ncurses.h>
  3.  
  4. main()
  5. {
  6.     int c;
  7.  
  8.     initscr();
  9.     cbreak();
  10.     noecho();
  11.     scrollok(stdscr, TRUE);
  12. #if 0
  13.     keypad(stdscr, TRUE);
  14. #endif
  15.     refresh();
  16.  
  17.     while ((c = getch()) != 'q') {
  18.         printw("Key pressed: %03c\n", c);
  19.         refresh();
  20.         }
  21.  
  22.     endwin();
  23. }
  24.  
  25.