[comp.sys.mac.programmer] ThinkC / ANSI / scanf question...

jwwalker@usceast.UUCP (Jim Walker) (05/03/90)

In article <691@nada.cs.utexas.edu> ted@cs.utexas.edu (Ted Woodward) writes:
[stuff deleted]
>I'd really like to be able to use printf and keydowns at the same time!
>I had to play around with DrawChar...

Here is some code posted to CompuServe by Philip Keller that will prevent
the console from intercepting keyboard events.  I don't claim to understand
it, but it works.

| The fix is also pretty obvious: nuke the driver's event mask to
| disregard all keyboard events, and your application gets to
| handle them instead of the driver.
| Here's a code fragment to demonstrate the fix:

|  DCtlHandle     dceH;
|  tty = fopenc ();
|  dceH = UTableBase [~ ((WindowPeek) tty->window)->windowKind];
|  (**dceH).dCtlEMask &= 0xFFC7;

Oh, I do know that you can use something like stdout in place of tty here.

-- 

   Jim Walker  jwwalker@usceast.cs.scarolina.edu  76367.2271@compuserve.com