Ignore:
Timestamp:
Aug 25, 1999, 1:37:07 AM (26 years ago)
Author:
phaller
Message:

Add: added ENABLE_LINE_MODE suport to CONIN$

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kernel32/conin.cpp

    r296 r670  
    1 /* $Id: conin.cpp,v 1.4 1999-07-12 17:20:03 phaller Exp $ */
     1/* $Id: conin.cpp,v 1.5 1999-08-24 23:37:07 phaller Exp $ */
    22
    33/*
     
    137137  pszTarget = (PSZ)lpBuffer;
    138138
    139   /* @@@PH: ConsoleMode: ENABLE_LINE_INPUT - blocks until CR is read */
    140 
    141139                                  /* block if no key events are in the queue */
    142140  for (;ulCounter==0;)                       /* until we got some characters */
     
    157155        if (InputRecord.EventType == KEY_EVENT)          /* check event type */
    158156        {
    159           *pszTarget = InputRecord.Event.KeyEvent.uChar.AsciiChar;
    160           pszTarget++;
    161           ulCounter++;
    162 
    163157                                                     /* local echo enabled ? */
    164158          if (pConsoleInput->dwConsoleMode & ENABLE_ECHO_INPUT)
     
    169163                        NULL);
    170164
     165          // console in line input mode ?
     166          if ( (pConsoleInput->dwConsoleMode & ENABLE_LINE_INPUT) &&
     167               (InputRecord.Event.KeyEvent.uChar.AsciiChar == 0x0d))
     168            goto __readfile_exit;
     169
     170          // record key stroke
     171          *pszTarget = InputRecord.Event.KeyEvent.uChar.AsciiChar;
     172          pszTarget++;
     173          ulCounter++;
     174
     175          // buffer filled?
    171176          if (ulCounter >= nNumberOfBytesToRead)        /* at buffer's end ? */
    172177            goto __readfile_exit;
Note: See TracChangeset for help on using the changeset viewer.