In article <DEREKN.92Aug12113036@vw.ece.cmu.edu>, derekn@vw.ece.cmu.edu (Derek B. Noonburg) writes:
|> I'm working on a program that needs to grab keystrokes from a console
|> (a shell window) as the keys are pressed (i.e., no line editing, no
|> buffering).
|>
|> Using raw mode seems to be the only way to do it, but I can't get it
|> to work. I wrote a little test program to send the escape sequence to
|> switch it into raw mode, read some events, and switch it back, but
|> it just hangs on the reads (I'm using the AmigaDOS Read() command,
|> which doesn't do buffering, right?). The switching to/from raw mode
|> works fine alone. It seems like something is swallowing the raw
|> information before it gets to my program.
|>
|> [This is on an Amiga 1000 with 2.04 ROMs.]
|>
|> - Derek
|> --
|> Derek Noonburg derekn@vw.ece.cmu.edu
|> Electrical & Computer Engineering Dept., Carnegie Mellon University
Why not get the key strokes through intuition IDCMP messages?
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.