Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!dewey.soe.berkeley.edu!mkent From: mkent@dewey.soe.berkeley.edu (Marty Kent) Newsgroups: comp.sys.mac.programmer Subject: (INSTRUCTIONS FOR) moving mouse pointer under program control Message-ID: <27930@ucbvax.BERKELEY.EDU> Date: 7 Feb 89 19:02:42 GMT References: <17871@gatech.edu> <6443@hoptoad.uucp> <1858@helios.ee.lbl.gov> Sender: usenet@ucbvax.BERKELEY.EDU Reply-To: mkent@dewey.soe.berkeley.edu.UUCP (Marty Kent) Organization: School of Education, UC-Berkeley Lines: 41 There are so many good reasons for a program to move the mouse around, I'm not going to waste time arguing about whether it's okay or not. I mostly work in lisp, so I'm not really familiar with the approved names for the necessary globals, but I know their addresses ("true names") and that's enough, eh? Here's how I move the mouse to screen point PT, in (what I hope is more or less) programming-language-independent pseudo-code: define constants (these are the addresses of the necessary sys globals) MOUSE = 2096 MBUSY = 2253 RMOUSE = 2092 MTEMP = 2088 CNEW = 2254 to set mouse cursor hotspot to screen point PT put-byte -1 @ MBUSY (i.e. store the byte -1 at the address bound to MBUSY - BASIC "poke" or C &MBUSY ...) put-long PT @ MTEMP put-long PT @ RMOUSE put-long PT @ MOUSE put-byte -1 @ CNEW put-byte 0 @ MBUSY This is a bit of an incantation to me, and I can't really explain how it works, though I know it's necessary to store the -1 in CNEW to get the system to redisplay the cursor image... However, my friend Dave Haessler used to say "understanding is the booby prize." This technique works. Marty Kent Sixth Sense Research and Development 415/642 0288 415/548 9129 MKent@dewey.soe.berkeley.edu {uwvax, decvax, inhp4}!ucbvax!mkent%dewey.soe.berkeley.edu Kent's heuristic: Look for it first where you'd most like to find it.