Is there a way to track the 3b1 mouse w/o pressing buttons?

Tom Tkacik CS/50 tkacik at hobbes.cs.gmr.com
Thu Jun 27 05:43:48 AEST 1991


In article <1991Jun26.165203.25919 at ecsvax.uncecs.edu>,
tcamp at ecsvax.uncecs.edu (Ted A. Campbell) writes:
|> 
|> I am revising my graphics software for the 3b1. This has both
|> TAM and MGR interfaces, but under TAM I can't seem to figure how
|> to track mouse position without a key on the mouse being pressed.
|> I've tried the TAM wreadmouse() call and the more generic
|> track() calls, and I've read the documentation on the two
|> mouse-related ioctl calls, but neither of them promises to
|> be able to read the present position of the mouse.  Can anyone
|> suggest a way that this can be done?

I do not have the documentation on hand, so my details might be wrong.
You use the wsetmouse() routine to tell when mouse reports should be given.
One of the parameters is a list of conditions, (ie. MSDOWN, MSUP, MSIN, MSOUT).
MSOUT means that the mouse should generate a mouse report whenever the mouse
is moved outside of a rectangle (whose coordinates are also given in the
wsetmouse() routine).  Just give the current mouse coordinates.  As long as the
mouse is not moved it will not generate a report, but if you move it just
a little bit, it will.  Mouse reports will also be reset.

Take the new mouse coordinates and re-issue wsetcommand().  A little bit of
thought will show that this does indeed work, (it took me quite a while
to understand it).  You can look at klondike to see how I implemeted 
dragging the cards around, (it's the same problem).  Grep for MSOUT.

Good luck.
--
Tom Tkacik
GM Research Labs
tkacik at hobbes.cs.gmr.com
tkacik at kyzyl.mi.org



More information about the Comp.sys.3b1 mailing list