[solved] Set a time out for inline_script item without using mouse or keyboard functions
Hello everyone,
I designed a experiment in which the subjects can click on a "image button" to choose a answer an proceed to next step (you can find detailed information here http://forum.cogsci.nl/index.php?p=/discussion/963/solved-collecting-response-time-when-using-image-button-with-inline-script#Item_5)
Everything is realized by python codes in inline_script item and I have no idea how to simply define a timeout since most solution I found are achieved with something like
"button, position, timestamp = my_mouse.get_click(timeout=20)".
I can't use this function because the function of "image button" demands already one mouse click.
Anyway the question seems to be very easy but I really did't find a solution and thus need your help.
Antonie
Comments
Hi Antonie.
Forms don't support timeouts (although it's on the tentative roadmap for the 2.9 series: issue #142). So you cannot use a form to collect a mouse click and use a timeout value, unfortunately. A workaround would be to make the form 'non-interactive', in which case it is just shown on the screen without waiting for user input, more-or-less like a
sketchpadwith a 0ms duration. You can do this by callingform.render()instead ofform._exec(). See:Then afterwards, you can use a
mouseobject in aninline_script(ormouse_responseitem in the GUI) to collect a mouse click with a timeout. The obvious downside is that you have to check the coordinates of the click to determine which button was clicked. So it's not ideal, but it should do the trick.Does that help at all?
Cheers,
Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!
Hi sebastiaan,
such a shame that timeout cannot be used in my experiment. But still thank you for your answer!
Antonie