Is it safe to block keyboard and mouse events?

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
makeshyft
Posts: 222
Joined: Mon Apr 15, 2013 4:41 am
Contact:

Is it safe to block keyboard and mouse events?

Post by makeshyft » Mon Oct 07, 2013 8:32 pm

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.
Founder & Developer @ MakeShyft R.D.A - https://www.makeshyft.com
Build Software with AppStarterStack for Livecode - https://www.AppStarterStack.com
Save Time with The Time Saver's Toolbox - https://www.TimeSaversToolbox.com

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Is it safe to block keyboard and mouse events?

Post by Simon » Mon Oct 07, 2013 9:02 pm

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
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

makeshyft
Posts: 222
Joined: Mon Apr 15, 2013 4:41 am
Contact:

Re: Is it safe to block keyboard and mouse events?

Post by makeshyft » Tue Oct 08, 2013 5:39 am

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
Founder & Developer @ MakeShyft R.D.A - https://www.makeshyft.com
Build Software with AppStarterStack for Livecode - https://www.AppStarterStack.com
Save Time with The Time Saver's Toolbox - https://www.TimeSaversToolbox.com

Post Reply