Page 1 of 1
Is it safe to block keyboard and mouse events?
Posted: Mon Oct 07, 2013 8:32 pm
by makeshyft
Hello Geniuses,
Is it safe to block keyboard and mouse events by using a front script to catch messages and then removing the front script when the "process" is done?
I want to do this to prevent people from clicking and typing while the engine is working through handlers.
Am I missing something? Can something go terribly wrong? Just trying to save time here.
Re: Is it safe to block keyboard and mouse events?
Posted: Mon Oct 07, 2013 9:02 pm
by Simon
Hi Tom,
The only problem I see in blocking actions is UX.
You should clearly alert the user to what is going on and possibly how long it will take. Use progress bars, the "busy" cursor etc.
Keep in mind that the user may also minimize your app so they can get on with other work, so maybe a modal "Finished" message would help.
I guess a purists would say something about an app should never block the user, which would mean give them something else to interact with that won't interfere with your running handlers (e.g.fill in a form at that point) or never block. Not my idea of fun.
These are just my thoughts on this, really I can't go as far as what "Best Practices" are in this case.
Simon
Re: Is it safe to block keyboard and mouse events?
Posted: Tue Oct 08, 2013 5:39 am
by makeshyft
Hi Simon,
Thanks for your reply. I'm gonna give it a shot and make sure it never gets "stuck" tapping messages.
For my app, the wait times will be rather short in most cases, so changing the cursor, and trapping messages makes sense to me.
Because the app is scalable to the limits of the OS, and SQLite, sometimes processing may indeed take a while. Those who will be dealing with thousands of people and thousands of files, they will generally be administrators, and they will dedicate the necessary CPU time I am sure.
Hoping for a multi-threaded 64-bit Livecode engine in time for really really large scale uses. Me thinks this is part of the "next generation" thing RunREv is talking about.
Thanks again,
Tom