Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!think.com!paperboy!hsdndev!husc6!unix!mxmora From: mxmora@unix.SRI.COM (Matt Mora) Newsgroups: comp.sys.mac.programmer Subject: Re: moving mouse Message-ID: <19263@unix.SRI.COM> Date: 17 Dec 90 19:49:51 GMT References: <945@van-bc.wimsey.bc.ca> Reply-To: mxmora@unix.UUCP (Matt Mora) Distribution: na Organization: SRI International, Menlo Park, CA Lines: 48 In article <945@van-bc.wimsey.bc.ca> dscheidt@van-bc.wimsey.bc.ca (Daniel Scheidt) writes: > > >How can I change the mouse location without moving the mouse? How do >you change the current mouse position returned by GetMouse? I need to >do this for a project using a track-ball. From the UMPG on page 21: by Chris Muir 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} -- ___________________________________________________________ Matthew Mora | my Mac Matt_Mora@sri.com SRI International | my unix mxmora@unix.sri.com ___________________________________________________________