Polling the mouse state

Ken Norris (dialup) pixelbird at interisland.net
Sat Feb 23 14:24:01 EST 2002


on 2/20/02 10:47 PM, Geoff Canyon at gcanyon at inspiredlogic.com wrote:

> If you have a specific need that seems to require "repeat while the mouse is
> down," post it and we'll see if we can figure a way around it.
> 
----------
Not exactly, but, how about this:

on mousestilldown
  put max(81,min(557,the mouseh)) into x
  put max(167,min(287,the mousev)) into y
  set the loc of me to x,y
end mousestilldown

...This is an oval (made round) button with the hilite set to true. It 'sees
through' a black-filled rectangular box, like a spyglass, so the user can
see portions of a color image underneath. It stays within the borders of the
box as you drag it around. The user is looking for an object.

When they find what they believe is the correct object, release the mouse
button (other stuff left out of the example):

on mouseUp
  global objCnt, plyrName,gmName,total,xFer,objName,verse
  get the loc of me
  if it is within rect of bg fld (objCnt+2) then
    --other stuff here--
  end if
end mouseUp

Thanks for looking,
Ken N.




More information about the use-livecode mailing list