Path: utzoo!mnetor!uunet!husc6!bloom-beacon!mit-eddie!ll-xn!ames!oliveb!pyramid!voder!apple!lsr From: lsr@Apple.COM (Larry Rosenstein) Newsgroups: comp.sys.mac.programmer Subject: Re: Finding MouseMoved Events Message-ID: <9300@apple.Apple.Com> Date: 2 May 88 17:58:30 GMT References: <8769@eleazar.Dartmouth.EDU> <3068@saturn.ucsc.edu> <23826@ucbvax.BERKELEY.EDU> Reply-To: lsr@apple.UUCP (Larry Rosenstein) Organization: Advanced Technology Group, Apple Computer Lines: 33 In article <23826@ucbvax.BERKELEY.EDU> oster@dewey.soe.berkeley.edu.UUCP (David Phillip Oster) writes: >In article <3068@saturn.ucsc.edu> alibaba@ucscb.UCSC.EDU (Alexander M. Rosenberg) writes: >>described, using GetMouse, you might take a look at the low-memory globals. >>I think that there is a global there that might do some of the work for you. > >Of course, if you do this you will instantly be incompatible with The low memory mouse variables are not documented very well (if at all), which means that they can be changed in the future. You should definitely call a trap to get the mouse position. GetMouse will return the mouse in local coordinates, which is probably not what you want. Instead, all OSEventAvail with a mask of 0. OSEventAvail returns the mouse in global (screen) coordinates. If you are really concerned about performance, then use GetTrapAddress to find out the address of the OSEventAvail trap and call it directly. The only risk in doing this is that some other code might patch OSEventAvail and you wouldn't be using the patched code. (This won't cause system problems, because any system patches are installed before INITs are run. The problem might show up as an incompatibility with some other INIT.) >If you are running under multifinder, WaitNextEvent returns mouseMoved as >a nullEvent with a bit set (in the message field?, in the modifers It returns an app4Evt, not a null event. The high byte of the message field distinguishes a mouse moved event from a suspend/resume event. -- Larry Rosenstein, Object Specialist Apple Computer, Inc. 20525 Mariani Ave, MS 27-AJ Cupertino, CA 95014 AppleLink:Rosenstein1 domain:lsr@Apple.COM UUCP:{sun,voder,nsc,decwrl}!apple!lsr