Inhibit mouse Events possible?

Scott Rossi scott at tactilemedia.com
Thu Jul 3 19:28:00 EDT 2014


Another option is to use a frontscript to intercept mouseup (or down) messages before they arrive at the controls on the card.  A frontscript is foolproof and will handle all controls, but you need to plan this carefully because, as Mark mentioned, you don't want to leave the stack unable to function normally.

Regards,

Scott Rossi
Creative Director
Tactile Media UX/UI Design

> On Jul 3, 2014, at 12:26 PM, William Prothero <prothero at earthednet.org> wrote:
> 
> Folks:
> Actually, I like the method of putting  a transparent rectangle over the stack window and trapping all mouse events. That makes the number of places where I have to modify my code much smaller. I have multiple buttons on the screen and they each call a number of handlers. I just thought there might be a command to disable mouse messages.
> Best,
> Bill
> 
>> On Jul 3, 2014, at 10:45 AM, Mark Schonewille <m.schonewille at economy-x-talk.com> wrote:
>> 
>> Hi Bill,
>> 
>> One way to do this:
>> 
>> local lBusy,lSecs
>> on mouseUp
>>  if lBusy is true then
>>     beep
>>     exit mouseUp
>>  else if lBusy is not true then
>>     put true into lBusy
>>     put the seconds into lSecs
>>     repeat forever with messages
>>        // some long task here
>>        if the seconds - lSecs > 5 then exit repeat
>>        wait 0 millisecs with messages
>>     end repeat
>>     put false into lBusy
>>  end if
>> end mouseUp
>> 
>> This script doesn't allow running the script again, as long as it hasn't finished. If you have multiple controls that should not be used while the script runs, you can disable the other controls or use a global variable and check the global variable in the other scripts.
>> 
>> --
>> Best regards,
>> 
>> Mark Schonewille
>> 
>> Economy-x-Talk Consulting and Software Engineering
>> Homepage: http://economy-x-talk.com
>> Twitter: http://twitter.com/xtalkprogrammer
>> KvK: 50277553
>> 
>> Installer Maker for LiveCode:
>> http://qery.us/468
>> 
>> Buy my new book "Programming LiveCode for the Real Beginner" http://qery.us/3fi
>> 
>> LiveCode on Facebook:
>> https://www.facebook.com/groups/runrev/
>> 
>>> On 7/3/2014 19:32, William Prothero wrote:
>>> Folks:
>>> 
>>> Is it possible to inhibit mouse events? Some of the operations that are initiated by a mouse click require a bit of time and I don’t want the user to be able to click around until each operation is finished. One approach would be to put a transparent rectangle over the stack and not pass events, but I wonder if there is a more direct way.
>>> 
>>> Thanks,
>>> Bill
>>> 
>>> William A. Prothero, Ph.D.
>>> University of California, Santa Barbara Dept. of Earth Sciences (Emeritus)
>>> Santa Barbara, CA. 93105
>>> http://es.earthednet.org/
>>> 
>>> 
>>> 
>>> _______________________________________________
>>> use-livecode mailing list
>>> use-livecode at lists.runrev.com
>>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>> 
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
> 
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode




More information about the use-livecode mailing list