Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!apple!Apple.COM!lsr From: lsr@Apple.COM (Larry Rosenstein) Newsgroups: comp.sys.mac.programmer Subject: Re: TrackButton() Message-ID: <2509@internal.Apple.COM> Date: 27 Jun 89 18:48:47 GMT Sender: usenet@Apple.COM Organization: Objects-R-Us, Apple Computer, Inc. Lines: 24 References:<128@dbase.UUCP> <23239@santra.UUCP> In article <23239@santra.UUCP> jmunkki@kampi.hut.fi (Juri Munkki) writes: > What if the user quickly presses and releases the mouse button on the > control and then moves the mouse away from the button area. Your routine > does not detect this. You should use GetNextEvent to find when the button The example code called StillDown which seems to be the right thing to do. StillDown returns FALSE if the event queue contains a mouseUp event, which would handle the case you describe. (You can also call WaitMouseUp, which does the same thing and removes the mouseUp from the event queue.) Perhaps you can elaborate on why this does not work with QuicKeys; the code does take into account mouseUp events. > comes up and where it comes up. Since GetNextEvent returns the mouse > location, you can remove the GetMouse too. But you would have to add a call to GlobalToLocal because GetNextEvent returns global coordinates and GetMouse returns local coordinates. Larry Rosenstein, Apple Computer, Inc. Object Specialist Internet: lsr@Apple.com UUCP: {nsc, sun}!apple!lsr AppleLink: Rosenstein1