deactivating mouse click to be able to type immediately in form
Hello all!
I am trying to make a retrieval test in which I show an image and ask for the associated object. I used the code below, but it requires participants to click first to the box to be able to type the answer. Pilot subjects found it a bit annoying, so is there a way not having to use mouse click and being able to type the answer immediately?
(ps: I saw that it's done by making focus='yes' in other posts, but I think it is not the case anymore).
form = Form( cols=[1], rows=[6, 1, 2], margins=(50,100,50,100), spacing=25 ) labelQuestion = Label( text=u'Which object?', center=True ) image = ImageWidget(path=cur_scene, adjust=True, frame=False) text_input = TextInput( text=u' ', frame=True, center=True, stub ='Type here..', return_accepts=True, var=u'response' ) form.set_widget(labelQuestion, (0,1)) form.set_widget(image, (0, 0)) form.set_widget(text_input, (0, 2))
Comments
Hi Irmak,
The
focus=yesapproach applies toform_baseitems, i.e. to OpenSesame script. In your case, you're using Pythoninline_script, in which case you can accomplish the same thing using thefocus_widgetkeyword when executing the form:Cheers!
Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!
Hi Sebastiaan,
Thank you very much! You saved me :)
Best,
Irmak