/************************************************************************ * * * Copyright Digital Equipment Corporation 1998. All rights reserved. * * * * Restricted Rights: Use, duplication, or disclosure by the U.S. * * Government is subject to restrictions as set forth in subparagraph * * (c) (1) (ii) of DFARS 252.227-7013, or in FAR 52.227-19, or in FAR * * 52.227-14 Alt. III, as applicable. * * * * This software is proprietary to and embodies the confidential * * technology of Digital Equipment Corporation. Possession, use, or * * copying of this software and media is authorized only pursuant to a * * valid written license from Digital or an authorized sublicensor. * * * ************************************************************************/ /* crmode_example.c */ /* Program to demonstrate the use of crmod() and curses */ #include main() { WINDOW *win1; char vert = '.', hor = '.', str[80]; /* Initialize standard screen, turn echo off. */ initscr(); noecho(); /* Define a user window. */ win1 = newwin(22, 78, 1, 1); /* Turn on reverse video and draw a box on border. */ setattr(_REVERSE); box(stdscr, vert, hor); mvwaddstr(win1, 2, 2, "Test cbreak input"); refresh(); wrefresh(win1); /* Set cbreak, do some input, and output it. */ crmode(); getch(); nocrmode(); /* Turn off cbreak. */ mvwaddstr(win1, 5, 5, str); mvwaddstr(win1, 7, 7, "Type something to clear the screen"); wrefresh(win1); /* Get another character, then delete the window. */ getch(); wclear(win1); touchwin(stdscr); endwin(); }