[comp.sys.mac.programmer] Mouse Handling

tonyj@marvin.Solbourne.COM (Tony Jackson) (12/08/89)

I am trying to attach a device to the serial port of a Mac which could
be used as a replacement for the mouse.

Talking to the device is simple. The problem I'm having is finding any 
information as to the location of the globals (?) or trap to use to
update the mouse coordinates. Shoving a pseudo-mouse event into the
queue doesn't work as that does not update the pointer location on the screen.

I've searched IM and TN fairly thoroughly, but have found nothing.

I would be grateful for any help, hints etc. 

Tony Jackson.
Solbourne Computer
tonyj@solbourne.com
(303) 678-4342

yahnke@vms.macc.wisc.edu (Ross Yahnke, MACC) (12/08/89)

In article <1989Dec7.183658.18691@Solbourne.COM>, tonyj@marvin.Solbourne.COM (Tony Jackson) writes...

-I am trying to attach a device to the serial port of a Mac which could
-be used as a replacement for the mouse.
- 
-Talking to the device is simple. The problem I'm having is finding any 
-information as to the location of the globals (?) or trap to use to
-update the mouse coordinates. Shoving a pseudo-mouse event into the

The HyperCard "Q & A Stack 3.1" contains a discussion of how to move
the mouse under program control.

>>>      Internet: yahnke@macc.wisc.edu        <<<
>>>   Mille voix chuchottent <<c'est vrai>>    <<<

cbm@well.UUCP (Chris Muir) (12/12/89)

In message <1989Dec7.183658.18691@Solbourne.COM> tonyj@marvin.Solbourne.COM 
(Tony Jackson) writes:
>I am trying to attach a device to the serial port of a Mac which could
>be used as a replacement for the mouse.
>
>Talking to the device is simple. The problem I'm having is finding any
>information as to the location of the globals (?) or trap to use to
>update the mouse coordinates. Shoving a pseudo-mouse event into the
>queue doesn't work as that does not update the pointer location on the screen.


This seems to come up every few months. I've posted bad Pascal code
for this SetMouse routine in the past. Here's a Think C version:


/* ------------------------- SetMouse ------------------------- */
/* some dangerous low-memory-global equates */
extern	Point	MTemp		:	0x828;
extern	Point	RawMouse	:	0x82c;
extern	Point	Mouse		:	0x830;
extern	Byte	MBState		:	0x172;
extern	int	CrsrNewCouple	:	0x8ce;  /* both New & Couple */
extern	Byte	CrsrNew		:	0x8ce;
extern	Byte	CrsrCouple	:	0x8cf;

#define 	Couple		0xff;	/* value for CrsrCouple */
#define 	Uncouple	0x00;	/* value for CrsrCouple */

void	SetMouse(where)
Point	where;
{
long	finalTicks;
	LocalToGlobal(&where);   /* Get ready to store mouse position */
	RawMouse = where;        /* into RawMouse */
	MTemp = where;           /* and MTemp */
	CrsrNewCouple = 0xffff;  /* Hit CrsrNew & CrsrCouple */
	Delay(5, &finalTicks);   /* let the cursor catch up */
}	/* SetMouse */



-- 
_______________________________________________________________________________
Chris Muir                             |   "There is no language in our lungs
{hplabs,pacbell,ucbvax,apple}          |    to tell the world just how we feel" 
!well!cbm                              |                         - A. Partridge