[no]raw

Raw mode only works with the Curses input routines [w]getch and [w]getstr. Raw mode is not supported with the DEC C RTL emulation of UNIX I/O, Terminal I/O, or Standard I/O.

Format

#include  <curses.h>

raw()

noraw()

Description

Raw mode reads are satisfied on one of two conditions: after a minimum number (5) of characters are input at the terminal or after waiting a fixed time (10 seconds) from receipt of any characters from the terminal.

Example

    /* Example of standard and raw input in Curses package. */
    
    #include <curses.h>
    
    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);
     leaveok( win1, TRUE);
     leaveok (stdscr,TRUE);
    
     box (stdscr, vert, hor);
    
     /* Reset the video, refresh(redraw) both windows. */
    
     mvwaddstr (win1, 2, 2, "Test line terminated input");
     wrefresh (win1);
    
     /* Do some input and output it. */
     nocrmode();
     wgetstr (win1, str);
    
     mvwaddstr (win1, 5, 5, str);
     mvwaddstr (win1, 7, 7, "Type something to clear screen");
     wrefresh (win1);
    
     /* Get another character then delete the window. */
    
     wgetch (win1);
     wclear (win1);
    
     mvwaddstr (win1, 2, 2, "Test raw input");
     wrefresh (win1);
    
     /* Do some raw input 5 chars or timeout - and output it. */
     raw();
     getstr (str);
     noraw();
     mvwaddstr (win1, 5, 5, str);
     mvwaddstr (win1, 7, 7, "Raw input completed");
     wrefresh (win1);
    
     endwin ();
    }
    


Previous Page | Next Page | Table of Contents | Index