🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.ibm.pc.programmer
Article #1069

A Better Mousetrap

#1069
From: Douglas R. Nebeker - MIS_SAS
Date: Thu, 08 Oct 1992 22:31
52 lines
1811 bytes
I'm building a mouse trap of sorts....

Actually, I just want to know if the mouse is being used (like the 
_good_ screen saver TSRs out there--they don't blank your screen when no 
keyboard input is coming in as long as the mouse is being moved).

I've successfully hooked the serial port interrupt (Int 14h?) and the mouse 
interrupt (Int 33h).  The mouse works like it always has, but my variable 
'busy' never gets changed... (actually, that's a lie--when the mouse is 
initialized, busy=M, but while the mouse is moving and buttons are being 
pushed, busy doesn't get changed)

My question then is this:  is there another way to access the mouse besides 
through Int 33h?  Does each mouse driver use a different Int for their 
driver?  Do I need to hook the DOS int 21h too?

Here is my example program:

	#include <dos.h>

	#ifdef __cplusplus
		#define __CPPARGS ...
	#else
		#define __CPPARGS
	#endif

	unsigned char busy;

	void interrupt ( *oldMOUSE)(__CPPARGS);
	void interrupt newMOUSE(__CPPARGS)
	{
		busy='M';
		oldMOUSE;
	}
	
	int main(void)
	{
	oldMOUSE = getvect(MOUSEINT);
	setvect(MOUSEINT,newMOUSE);
	
	keep(0, (_SS + (_SP+128/16) - _psp));
	return 0;
	}


THANKS A LOT


____

Douglas R. Nebeker           Internet: $doug@sasb.byu.edu
Technical Details
Message-ID: <$dougn.64.0@sasb.byu.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!know!cass.ma02.bull.com!think.com!yale.edu!jvnc.net!darwin.sura.net!gatech!news.byu.edu!hamblin.math.byu.edu!yvax.byu.edu!sasb.byu.edu!$dougn

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!know!cass.ma02.bull.com!think.com!yale.edu!jvnc.net!darwin.sura.net!gatech!news.byu.edu!hamblin.math.byu.edu!yvax.byu.edu!sasb.byu.edu!$dougn
From: $dougn@sasb.byu.edu (Douglas R. Nebeker - MIS_SAS)
Newsgroups: comp.sys.ibm.pc.programmer,comp.os.msdos.programmer
Subject: A Better Mousetrap
Keywords: mouse interrupt trap
Message-ID: <$dougn.64.0@sasb.byu.edu>
Date: 8 Oct 92 22:31:19 GMT
Organization: Brigham Young University
Lines: 52
Nntp-Posting-Host: 128.187.245.25