Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!gem.mps.ohio-state.edu!apple!well!cbm
From: cbm@well.UUCP (Chris Muir)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Modifying the mouse input
Summary: Here's the compliment to GetMouse.
Message-ID: <13863@well.UUCP>
Date: 28 Sep 89 19:07:03 GMT
References: <14701@bloom-beacon.MIT.EDU>
Reply-To: cbm@well.UUCP (Chris Muir)
Organization: Whole Earth 'Lectronic Link, Sausalito, CA
Lines: 40

Here's the other side of GetMouse, SetMouse:

 procedure SetMouse (where: point);
  var
   LowGlob: integer;
   LowMem: ptr;
   PointPtr: ^point;
   finalTicks: longint;
  const
    {some dangerous low-memory-global equates}
   MBState = $172;      {byte}
   MTemp = $828;        {point}
   RawMouse = $82c;     {point}
   Mouse = $830;        {point}
   CrsrNew = $8ce;      {byte}
   CrsrCouple = $8cf;   {byte}
   Couple = $ff;        {value for CrsrCouple}
   Uncouple = $00;      {value for CrsrCouple}
 begin
  LocalToGlobal(where);             {Get ready to restore old mouse position}
  LowMem := pointer(RawMouse);      {point to low memory}
  PointPtr := @LowMem^;             {treat it as a point}
  PointPtr^ := where;               {store saved mouse position into it}
  LowMem := pointer(MTemp);         {point to low memory}
  PointPtr := @LowMem^;             {treat it as a point}
  PointPtr^ := where;               {store saved mouse position into it}
  LowMem := pointer(CrsrNew);
  LowMem^ := $ffff;                 {both CrsrNew & CrsrCouple}
  Delay(5, finalTicks);             {let the cursor catch up}
 end;       {SetMouse}


Note thet it uses undocumented low memory globals.


-- 
_______________________________________________________________________________
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