Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ncar!ames!vsi1!apple!well!cbm From: cbm@well.UUCP (Chris Muir) Newsgroups: comp.sys.mac.programmer Subject: Re: moving mouse pointer under program control Message-ID: <10647@well.UUCP> Date: 7 Feb 89 16:56:18 GMT References: <17871@gatech.edu> Reply-To: cbm@well.UUCP (Chris Muir) Organization: Whole Earth 'Lectronic Link, Sausalito, CA Lines: 47 In Article 4603 in comp.sys.mac.programmer, robinson@pravda (Stephen M. Robinson) asks about moving mouse pointer under program control. A (bad, but works) Pascal example: 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} All the usual cautions about the User Interface Police apply. B -- _______________________________________________________________________________ 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