Lock screen and disable user input

The place to discuss anything and everything about running your LiveCode on Android

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Joe Kot
Posts: 37
Joined: Wed Sep 14, 2011 2:49 pm

Lock screen and disable user input

Post by Joe Kot »

I'm developing a children's program. Small children tend to repeatedly tap a button/field. This unfortunately triggers multiple events and so the program does not stop at the appropriate time. The following code works for windows operating systems. But flushevents does not work for android applications. Disable does not work either. Events are still stored. Any ideas would be appreciated.
lock screen
wait 5 seconds
get flushevents ("all") -- <------------
unlock screen
Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Lock screen and disable user input

Post by Klaus »

Hi Joe,

in situatuons like these I usually show a filled(!) graphic on top of the card
with its INK set to "noop" and give it a dummy script:

Code: Select all

on mouseup
  ## nada :-)
en mouseup
That will "catch" all TAPping and can be hidden again when TAPping is allowed again.

Code: Select all

...
show grc "eventcatcher"
lock screen
wait 5 seconds
hide grc "eventcatcher"
unlock screen
...
You get the picture.


Best

Klaus
Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am

Re: Lock screen and disable user input

Post by Dixie »

have a look at 'mobileClearTouches' in the dictionary...
Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Lock screen and disable user input

Post by Klaus »

Ah, "mobileClearTouches", cool, thanks for the hint :D
Joe Kot
Posts: 37
Joined: Wed Sep 14, 2011 2:49 pm

Re: Lock screen and disable user input

Post by Joe Kot »

Added the following to my program and its works great. I will also try the filled(!) graphic on top of the card approach.
Thank you both for the help. - Joe
if the environment is "mobile" then mobileClearTouches
else
get flushevents ("all") -- <------------
end if
Post Reply