Polling the mouse

Scott Raney raney at metacard.com
Thu Feb 21 21:49:01 EST 2002

On Thu, 21 Feb 2002 "J. Scott Saults" <saultsj at missouri.edu> wrote:

> Thu, 21 Feb 2002 12:58:57 -0700 (MST)
> Scott Raney <raney at metacard.com> wrote
> >You'd also be subject to the normal behavior of
> >async functions (e.g., in HC, "the mouse" returns "down" if the user
> >clicked down anytime between when the handler started running and when
> >the function is called, whereas an async implementation would only
> >return "down" if it was actually down when you made the call).
> Just for the sake of accuracy,  in HC & SuperCard , the mouse function does 
> NOT necessarily reutun "down"  if the user clicked anytime between when the 
> handler started and when the function is called. Both SuperCard and 
> HyperCard return the actual state of the mouse, up or down, whenever the 
> mouse function is called within a handler, at least under Mac OS 9. Perhaps 
> it works differently in OS X.

I didn't check SC, but HC definitely does not work the way you say.  Try it
yourself and see.  Put the following script in a button, then click to
run it and click again before the repeats finish (you may need to
adjust the count depending on the speed of your system):
on mouseUp
  get 0
  repeat for 10000 times
    add 1 to it
  end repeat
  put the mouse
end mouseUp

It's compatibility at that level that's hard to do, convenient as it
might be for some things.

Scott Raney  raney at metacard.com  http://www.metacard.com
MetaCard: You know, there's an easier way to do that...

More information about the use-livecode mailing list