[comp.sys.ibm.pc] ^C Echo: Summary of Suggestions, & What Worked

cramer@optilink.UUCP (Clayton Cramer) (03/28/90)

Thanks to everyone who came up with suggestions.  Below are some of
the suggestions I received:

I've tested the code at work (with our libraries, of course), and it seems
to work fine for me.  There are a couple of things that you might want to
check.  First, if you have any TSRs in the machine, repeat your tests
without them installed.  If there's anybody else filtering 0x1B or 0x16,
there might be a problem.  Second, put in some code to make sure your
ISRs are getting control - perhaps each could increment its own global
variable, which it displays at a fixed location on the screen (probably
best to display it via direct video memory access, since you're in an ISR).
Another thing might be to double check the character code/scan code values
you're testing for - the symptom you've described could occur if you a
accidentally reversed the codes, or checked for the wrong ones.

Good Luck!

Pat McCarthy
mccarthy@well.uucp

----------------------------------------------------------------------
I wrote a program that used Ctr-C as a command character by
just reading for ctrl-C through interrupt 16h, service 0.
 
Int 9 doesn't treat Ctrl0S, Ctrl-C, or Ctrl-Q as special -- DOS does.
The ctrl-break combo does get intercepted by int 9 and
int 1c (I believe -- might be 1b) is called (which in turn calls another
interrupt if you're in DOS, int 23, I believe..

----------------------------------------------------------------------
Hello,

It turns out that the ^C echoed by DOS is written to stdout. Thus, if
you don't need stdout, you can redirect it to nul from within your
program (using dup2()), thereby sending the ^C to the bit-bucket.
Hope this helps.

Ge van Geldorp
ge@dutlru2.tudelft.nl
...!uunet!hp4nl!dutlru2.tudelft.nl!ge
----------------------------------------------------------------------
It turned that the simplest solution, and the one that worked most
obviously, was van Geldorp's suggestion.  Of course, if you need
stdout to print somewhere, this won't solve your problem, but it
solved mine!  (I used freopen to redirect stdout to NUL).

Thanks all for your help.

-- 
Clayton E. Cramer {pyramid,pixar,tekbspa}!optilink!cramer
Politicians prefer unarmed peasants.  Ask the Lithuanians.
----------------------------------------------------------------------------
Disclaimer?  You must be kidding!  No company would hold opinions like mine!