Microsoft KB Archive/10619

From BetaArchive Wiki
Knowledge Base


Light Pen Won't Work with Mouse Installed

Article ID: 10619

Article Last Modified on 9/24/2003



APPLIES TO

  • Microsoft Mouse Driver 9.0 Standard Edition
  • Microsoft Mouse Driver 9.1 Standard Edition
  • Microsoft Mouse Driver 7.04 Standard Edition
  • Microsoft Mouse Driver 8.2 Standard Edition



This article was previously published under Q10619

SUMMARY

If you have both a mouse and a light pen installed, you may get conflicts between the two. This is because the Microsoft Mouse can be used to emulate a light pen.

When installed, the mouse driver is initialized with "light pen emulation mode" turned on. Pressing both mouse buttons simultaneously indicates pen touching the screen; releasing the buttons indicates pen off the screen.

If a light pen is installed with the mouse driver in the above condition, the light pen cannot function correctly. Light pen information is collected using an INT 10h DOS call, code 4. With the mouse's pen emulation mode turned on, the pen does not appear to work properly because the mouse driver is pointing that interrupt's vector to its own routine instead of to the regular light pen handler.

For the pen to work properly with the mouse driver installed, mouse function 14 must be called to turn pen emulation mode off. Once disabled, emulation mode is reenabled by calling mouse function 13. See the Microsoft Mouse Programmer's Reference for documentation of the mouse function calls.

MORE INFORMATION

The following is a short BASIC program you can run to disable or enable the mouse's light pen emulation mode:

10 INPUT "(1) Disable or (2) Enable light pen emulation";P%
20 IF P% <> 1 AND P% <> 2 THEN PRINT "WRONG RESPONSE, TRY AGAIN":GOTO
   10
25 DEF SEG =0
30 MSEG = 256 * PEEK(51*4+3) + PEEK(51*4+2)
40 MOUSE = 256 * PEEK(51*4+1) + PEEK(51*4)+2
50 IF MSEG AND MOUSE THEN 70
60 PRINT "MOUSE DRIVER NOT FOUND":END
70 DEF SEG = MSEG
80 IF P% = 1 THEN M1% = 14 ELSE M1% = 13
90 CALL MOUSE(M1%,M2%,M3%,M4%)
100 DEF SEG          'restore segment to BASIC's data segment
                

Line 90 contains Mx% because the mouse function calls are expecting four parameters to be passed, even if no value is assigned to one or more of them.


Additional query words: 7.00 7.04 7.05 8.00 8.10 8.20 9.00

Keywords: KB10619