Page 1 of 1

Lock screen and disable user input

Posted: Sun Jan 05, 2014 4:35 pm
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

Re: Lock screen and disable user input

Posted: Sun Jan 05, 2014 5:19 pm
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

Re: Lock screen and disable user input

Posted: Sun Jan 05, 2014 5:19 pm
by Dixie
have a look at 'mobileClearTouches' in the dictionary...

Re: Lock screen and disable user input

Posted: Sun Jan 05, 2014 5:22 pm
by Klaus
Ah, "mobileClearTouches", cool, thanks for the hint :D

Re: Lock screen and disable user input

Posted: Sun Jan 05, 2014 6:19 pm
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