[comp.sys.3b1] Is there a way to track the 3b1 mouse w/o pressing buttons?

tcamp@ecsvax.uncecs.edu (Ted A. Campbell) (06/26/91)

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?

Why? because I want to implement a "rubberbanding routine"
(Please, no VDI) that will track a rectangle while a button
is depressed.  Any help will be appreciated.

Ted A. Campbell
tcamp@uncecs.edu

tkacik@hobbes.cs.gmr.com (Tom Tkacik CS/50) (06/27/91)

In article <1991Jun26.165203.25919@ecsvax.uncecs.edu>,
tcamp@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@hobbes.cs.gmr.com
tkacik@kyzyl.mi.org