Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!wasatch!uplherc!wicat!keithm From: keithm@wicat.UUCP (Keith McQueen) Newsgroups: comp.sys.ibm.pc Subject: Re: Control-Break ignored in Turbo-C graphics mode.... Message-ID: <401@wicat.UUCP> Date: 10 Apr 89 18:42:57 GMT References: <89Apr4.202845edt.2759@godzilla.eecg.toronto.edu> <4212@ttidca.TTI.COM> Reply-To: keithm@wicat.UUCP (Keith McQueen) Distribution: na Organization: WICAT Systems, Orem, Utah Lines: 29 >In article <89Apr4.202845edt.2759@godzilla.eecg.toronto.edu> lansd@eecg.toronto.edu (Robert Lansdale) writes: } I have a small problem trying to get Control-Break to be }recognized while in graphics mode, using Turbo-C's Hercules BGI driver }(version 2.0). I initially revector the control-break handler to my own }handler using the ctrlbrk(handler) command, which works fine while in text }mode, but is ignored once I switch over to graphics. I assume the }BGI driver is vectoring the interrupt to itself. Any suggestions? The problem is that control-break is only checked by DOS during I/O and possibly at other key points during DOS interrupts. When you are in graphics mode, you have bypassed the DOS I/O and started outputing directly to video RAM. All is not lost, however. The keyboard interrupt that recognizes the actual keypress maintains a flag in low RAM that can be inspected by a user program at key intervals. The flag is kept at address 0:471 and is the high-order bit of the byte. This bit is set to a 1 when control-break is detected. Your program can check it at regular intervals and handle the situation accordingly. Be sure to clear the bit after you have handled things. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | Keith McQueen, N7HMF Organization: Wicat Systems, Inc. | | 1116 Graff Circle Work (801)224-6605x422 | | Orem, Utah 84058 Packet: N7HMF @ NV7V | | Home (801)224-9460 Voice: 147.340 MHz or 449.675 MHz | | =====> My opinions are all mine... <===== | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -