[Coco] [Color Computer] Update: Inkey for Microware C...

KnudsenMJ at aol.com KnudsenMJ at aol.com
Tue Dec 9 15:50:01 EST 2003


In a message dated 12/8/03 10:52:22 PM Eastern Standard Time, 
mannequin at primary.net writes:

> So, when I compile and run this, it always prints the character I typed
>  in before it hits the printf () function. Here's an example:
<snip>
>  So how do I go about defeating this?

Someone else posted the fancy way to turn off ECHO mode, using a struct and a 
couple of system calls.  I turn it off with

system("tmode -echo");

or the like.  The fancy method is best, because you can save all the original 
settings and put them back with one call before your program exits.  Assuming 
it exits normally -- we've all had windows left in weird states when some app 
crashed and burned.

You can rig a C program to intercept BREAK and exit under its own volition, 
after restoring everything, but that's another code example, using the 
Microware C Library's intercept() function -- another place, BTW, where OS-9 is easier 
to deal with than *NIX.  --Mike K.




More information about the Coco mailing list