Page 1 of 1

Lock screen and disable user input

Posted: Tue Sep 10, 2013 7:12 am
by kunoir
Hi everyone,

First post :D

I am creating a guessing the animal game and have four choices. Once the correct/incorrect animal is chosen I would like to create a green/red square around the choice and lock the screen for 5 seconds.

I just used:

set the visible of graphic correctRectangle to true
lock screen
wait 5 seconds
unlock screen

But when this happens and if you click 5 times on another button during the waiting period it will proceed to process those clicks later.

Anyone know any fixes for this?

Re: Lock screen and disable user input

Posted: Tue Sep 10, 2013 7:28 am
by Simon
Hi kunoir,
Welcome to the forum :)

You can use Disable/Enable even on an image.
I'm guessing you code an "on mouseUp" to your images so you would add in the card script a routine to disable all the images for 5 seconds.

Code: Select all

disable image "myImage"

Simon

Re: Lock screen and disable user input

Posted: Tue Sep 10, 2013 9:23 am
by bn
Hi kunoir,

you could also use flushevents after your wait.

Wait is blocking and system event might pile up during the wait. That is what you see. Using flushevents you cancel all those piled up system messages.

Code: Select all

set the visible of graphic correctRectangle to true
lock screen
wait 5 seconds
get flushevents ("all") -- <------------
unlock screen
look up flushevents in the dictionary, it is nicely explained, instead of "all" you can flush specific events.

Kind regards
Bernd

Re: Lock screen and disable user input

Posted: Tue Sep 10, 2013 11:09 am
by kunoir
Awesome I will give both these solutions a try and get back to you. Thanks so much for the help.