home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / sys / amiga / programm / 17616 < prev    next >
Encoding:
Text File  |  1992-12-21  |  2.0 KB  |  93 lines

  1. Path: sparky!uunet!noc.near.net!hri.com!spool.mu.edu!yale.edu!ira.uka.de!smurf.sub.org!ppcnet!sks!stesch
  2. From: stesch@sks.ppc.sub.org (Stefan Scholl)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: Console RAW mode.
  5. Message-ID: <VfL9s*VT0@sks.ppc.sub.org>
  6. Date: 19 Dec 92 13:34:33 GMT
  7. References: <1992Dec17.051157.23971@serval.net.wsu.edu>
  8. Organization: _private_ site
  9. Lines: 78
  10. Content-Type: text/plain; charset=ISO-8859-1
  11. Content-Transfer-Encoding: 8bit
  12. MIME-Version: 1.0
  13. X-Newsreader: Arn V1.00
  14.  
  15.  
  16. Just test this:
  17. -------------------------------------------
  18. #include <proto/dos.h>
  19. #include <stdio.h>
  20.  
  21.  
  22. void main(void)
  23. {
  24.   long c;
  25.  
  26.   SetMode(Input(), 1);
  27.   while((c = FGetC(Input())) != 24)
  28.   {
  29.     FPutC(Output(),c);
  30.     Flush(Output());
  31.   }
  32.   SetMode(Input(), 0);
  33. }
  34.  
  35. -------------------------------------------
  36.    NAME
  37.     SetMode - Set the current behavior of a handler (V36)
  38.  
  39.    SYNOPSIS
  40.     success = SetMode(fh, mode)
  41.     D0                D1  D2
  42.  
  43.     BOOL SetMode(BPTR, LONG)
  44.  
  45.    FUNCTION
  46.     SetMode() sends an ACTION_SCREEN_MODE packet to the handler in
  47.     question, normally for changing a CON: handler to raw mode or
  48.     vice-versa.  For CON:, use 1 to go to RAW: mode, 0 for CON: mode.
  49.  
  50.    INPUTS
  51.     fh   - filehandle
  52.     mode - The new mode you want
  53.  
  54.    RESULT
  55.     success - Boolean
  56.  
  57.    SEE ALSO
  58. -------------------------------------------
  59.  
  60.  
  61.  
  62.  
  63. Or use SAS/C's9 getch
  64. -------------------------------------------
  65. getch()-Get a character from stdin immediately
  66.  
  67. Synopsis
  68.  
  69.    #include <stdio.h>
  70.  
  71.    c = getch(void);
  72.  
  73.    int c;      /* return character or code */
  74.  
  75. Portability
  76.  
  77.    SAS/C
  78.  
  79. Returns
  80.  
  81.    If successful, the next input character is returned.  Otherwise, the
  82.    function returns EOF, which is defined in <stdio.h>.  In the event of
  83.    an EOF return, error information can be found in errno and _OSERR.
  84. -------------------------------------------
  85.  
  86.  
  87. _____________
  88. 9 SAS/C 6.x
  89.  
  90. -- 
  91. ////Stefan Scholl////stesch@sks.ppc.sub.org////\ ////ISO-8859-1:dv|DV\_////\
  92. \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/ \\\\\\\\\\\\\\\\\\\\\\\\\\/
  93.