Article View: comp.os.msdos.programmer
Article #6303Re: Capturing Mouse Interrupts
From: MORTEN KNUDSEN
Date: Mon, 16 Nov 1992 18:28
Date: Mon, 16 Nov 1992 18:28
34 lines
2106 bytes
2106 bytes
In article <ua#@byu.edu> $dougn@sasb.byu.edu (Douglas R. Nebeker - MIS_SAS) writes: >Help! > >I am trying to hook the mouse interrupts so that each time the mouse is >moved, my routine can be notified. I've tried hooking Int 33h, but found >that didn't work since Int 33h is only called to initialize the mouse and/or >driver. Int 33h, AX=24h returns the IRQ number and tells me that my mouse >is using IRQ 4 (I have comfirmed this with other utilities). > >However, when I hook IRQ4, the mouse still works great, but my routine is >never notified of any mouse movements. When I check those routines that >show the owner of the different IRQs, they DON'T show my program (but they >DO show my program owning other interrupts that I've hooked in the same way). > >Now...could it be that everytime I go into a program that uses the mouse >that the program itself initializes the mouse, which "unhooks" my process >from the interrupt chain? If this is so, how can I keep my mouse routine >hooked?!? > > >Thanks in advance for ANY help! > >____ > >Douglas R. Nebeker Internet: $dougn@sasb.byu.edu I had this problem myself when writing a screen saver. This is what I did, using com1 as an example: I hooked int21, in order to prevent the mouse driver in getting back the com1 vector. When the mouse driver tries to get the com1 vector , I give it my old com1 vector (what the com1 vector was before I hooked it). When the mouse driver tries to set the com1 vector, I store the vector as my old com1 vector. Cute? Workes great, too. I could mail you the code, if you want.
Technical Details
Message-ID:
<mortenk.77.721938519@dhhalden.no>Path:
arc1-ca.pugleaf.net!sparky!uunet!mcsun!sunic!aun.uninett.no!nuug!dhhalden.no!pc153.dhhalden.no!mortenkReferences:
<ua#@byu.edu>Show Full Headers
Complete Article Headers
Newsgroups: comp.os.msdos.programmer Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!sunic!aun.uninett.no!nuug!dhhalden.no!pc153.dhhalden.no!mortenk From: mortenk@dhhalden.no (MORTEN KNUDSEN) Subject: Re: Capturing Mouse Interrupts Message-ID: <mortenk.77.721938519@dhhalden.no> Keywords: mouse capture interrupt IRQ Lines: 34 Sender: news@dhhalden.no (Network News User) Nntp-Posting-Host: pc153 Organization: Ostfold College References: <ua#@byu.edu> Date: Mon, 16 Nov 1992 18:28:39 GMT