Repeats and mouse events

Charles Silverman csilverm at acs.ryerson.ca
Tue Feb 12 11:26:01 EST 2002


Hi,
   This bit of code doesn't work right (though in Supercard it's fine) I've
seen recommendations for using "send" but don't I open up to other
inadvertent/undesirable user events or processes happening. I need to keep
the user focused within a specific loop. Am I missing something?

Here's the kind of code I'm talking about. In this example the script goes
into a btn and there's a single fld . Warning... This code has crashed Rev
and frozen my computer (Mac Pismo PB).

The larger purpose of this code is for the creation of single switch
software for kids who can't manipulate a keyboard but can press and release
switches. I've been doing this stuff for years in SuperCard.  I need to
carefully scrutinize switch (mouse btn in this case) activity to accommodate
for a variety of behaviors. The code strategy below is what I traditionally
use for hiliting a series of objects (btns, flds, text within field, etc.)
one at a time, for a duration of time, and as well, using the amount of time
involved in mouse downs and ups to create multiple signal possibilities.

Any thoughts on this appreciated.

-Charles Silverman


--
On mousedown
 get flushevents("mousedown")
End mousedown

On mouseup
 Put the seconds into tStartHere
 Repeat 
  put the seconds - tStartHere into tTimeNow
  if tTimeNow > 15 then exit repeat
  if the mouse is down then
      put "You got It" into fld 1
      beep
      wait until the mouse is up
      exit repeat
   end if
 end Repeat
Put "" into fld 1
End mouseup  
--





      




More information about the use-livecode mailing list