home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / sys / amiga / programm / 12239 < prev    next >
Encoding:
Internet Message Format  |  1992-08-12  |  1.8 KB

  1. Path: sparky!uunet!sun-barr!ames!lll-winken!taco!hamlet.uncg.edu!thyerj
  2. From: thyerj@hamlet.uncg.edu (Jonathan S. Thyer)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: console device raw mode
  5. Message-ID: <1992Aug12.194300.13523@ncsu.edu>
  6. Date: 12 Aug 92 19:43:00 GMT
  7. References: <DEREKN.92Aug12113036@vw.ece.cmu.edu>
  8. Sender: news@ncsu.edu (USENET News System)
  9. Distribution: comp
  10. Organization: North Carolina State University
  11. Lines: 26
  12.  
  13. In article <DEREKN.92Aug12113036@vw.ece.cmu.edu>, derekn@vw.ece.cmu.edu (Derek B. Noonburg) writes:
  14. |> I'm working on a program that needs to grab keystrokes from a console
  15. |> (a shell window) as the keys are pressed (i.e., no line editing, no
  16. |> buffering).
  17. |> 
  18. |> Using raw mode seems to be the only way to do it, but I can't get it
  19. |> to work.  I wrote a little test program to send the escape sequence to
  20. |> switch it into raw mode, read some events, and switch it back, but
  21. |> it just hangs on the reads (I'm using the AmigaDOS Read() command,
  22. |> which doesn't do buffering, right?).  The switching to/from raw mode
  23. |> works fine alone.  It seems like something is swallowing the raw
  24. |> information before it gets to my program.
  25. |> 
  26. |> [This is on an Amiga 1000 with 2.04 ROMs.]
  27. |> 
  28. |> - Derek
  29. |> --
  30. |> Derek Noonburg                                derekn@vw.ece.cmu.edu
  31. |> Electrical & Computer Engineering Dept., Carnegie Mellon University
  32.  
  33.  
  34.     Why not get the key strokes through intuition IDCMP messages?
  35. I think the NewWindow strcuture idcmp flag name is RAWKEY.  This should work if you just want raw keystrokes and don't want to print them.  If you want to print them on the screen, you can use PrintIText with an appropriate pointer to a buffer etc...  but it may be better to use console device in this case.
  36. --
  37. Jonathan S. Thyer
  38. InterNet: thyerj@iris.uncg.edu
  39.