Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!samsung!uakari.primate.wisc.edu!pikes!udenva!news From: news@udenva.cair.du.edu (netnews) Newsgroups: comp.sys.ibm.pc Subject: Re: MicroSoft Mouse Message-ID: <12476@udenva.cair.du.edu> Date: 29 Nov 89 20:55:11 GMT References: <423@wjh12.harvard.edu> Reply-To: ptripp@zephyr.cair.du.edu (Phil Tripp) Distribution: na Organization: Univ. of Denver, CO, USA Lines: 66 In article <423@wjh12.harvard.edu> djb@wjh12.UUCP (David J. Birnbaum) writes: >blanker and I would like to modify it to check for mouse >activity. If anyone out there has a mouse manual, could you >please send me email explaining how to do this? I understand >that the mouse is called with 33h, but I have no idea what >goes in which register. Here is some code that I use to monitor an IBM PS/2 mouse. The documentation for this mouse states that the device driver for the PS/2 mouse allows the mouse to be used by applications that use the interface designed by Microsoft. So this code might work for you with some minor adaptation, of course. Just issue an Int 33h when it's time to blank the screen, and if the X or Y or one of the button statuses has changed, treat it like a keystroke, i.e. don't blank the screen. ;------------------------------------------------------------------------+ ; | ; G L O B A L V A R I A B L E S | ; | ;------------------------------------------------------------------------+ DATASEG segment word public 'data' public ps2_x_ ;X coordinate of IBM PS/2 mouse public ps2_y_ ;Y coordinate of IBM PS/2 mouse ps2_x_ dw 0 ;Start at 0,0 ps2_y_ dw 0 ;Start at 0,0 DATA ends ;------------------------------------------------------------------------+ ; Code Segment | ;------------------------------------------------------------------------+ CODESEG segment word public 'code' assume cs:CODESEG,ds:DATASEG,ss:DATASEG,es:DATASEG ;------------------------------------------------------------------------+ ; ps2_mouse() - Get data from an IBM PS/2 mouse. | ; | ; Returns button status in AX. | ; Bit 0 Left button (1 = down, 0 = up) | ; Bit 1 Right button (1 = down, 0 = up) | ;------------------------------------------------------------------------+ public ps2_mouse_ ps2_mouse_ proc near mov ax,03 ;3 = Get Position and Button Status int 33h ;Mouse driver interrupt mov ax,bx ;AX = BX = button status mov ds:ps2_x_,cx ;Store X position mov ds:ps2_y_,dx ;Store Y position ret ps2_mouse_ endp ;------------------------------------------------------------------------; ;------------------------------------------------------------------------; CODESEG ends end