Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

TextInput in form, auto focus

Hi,

I'm building an experiment with Open sesame. In this experiment, I use a form and the widget TextInput (with inline script Python) so participants can write their responses.

Currently, the participant has to click in the frame before to write his response. I would like to be allowed to write the answer without this click (directly when this form displays itself). How can I force the focus ?


Thanks you for your help!


NB: I'm using the backend "PsychoPy, powerful stimulusgeneration"

Comments

  • Hi @Ines_,

    Not sure how your code is implemented but check that you have included "focus=yes" in the setting of the text_input widget:

    For example:

    widget 0 2 1 1 text_input focus=yes return_accepts=yes stub="" var="[form_var]"

    If you didn't have this, I believe it might solve your problem.

    Best,

    Fabrice.

    Buy Me A Coffee

  • Hi,

    Thank you for your answer.

    Actually, I tried:

    However, I have this error message:

    TypeError: __init__() got an unexpected keyword argument 'focus'


    Inès

  • Hey @Fab


    Your solution maybe work using OpenSesameScript, but do you have any clues about using this with a Python inline script ?


    Best regards,


    Inès

  • Hi @Ines_,

    I'm no expert with the forms/Python, but if you upload a basic working example with your form, I can take a look and see if I can come up with something.

    Best,

    Fabrice.

    Buy Me A Coffee

  • Hi,

    Thank you for your answer!

    I'm adding an Opensesame file with the form. It's a form with textInput to enable participants to write their answers (names of items to remember in different positions in a list). They have to write lots of answers. Thus, it isn't ergonomic to have to click in the frame before to write.

    Best regards,


    Inès

  • Hi @Ines_,

    I poked around a little but no luck so far. As far as I can tell, the system's focus seems to be out of the whole task window, as if you press ESC when one the second screen (Response_part), OS does not register it until you click on the window.

    Even though you're not using Tkinter, one solution (https://forum.cogsci.nl/discussion/5172/problem-using-tkinter-interface) solves that latter problem - the window does appear to regain focus - , but I couldn't find a way to force the focus to a specific widget in Python. From what I read on the web, I think that using Tkinter to set up your form might make it easier (Tkinter objects appear to take a .focus() property), though it can bring its own focus issues

    I don't know enough about Python and the implementation of the widgets in OS to solve this one, but have you considered using the built-in form objects instead of creating it from Python? This would make the issue simpler as you'd just be able to use focus=yes option.

    Alternatively, the solution proposed here might also be an option, as it offers a way to create the widgets and emulate a mouse click on a specific object: https://forum.cogsci.nl/discussion/447/open-form-enter-button.

    Hope these pointers can be of help.

    Fabrice.

    Buy Me A Coffee

  • Hi @Fab,

    Thank you very much for your elaborate answer!

    It was very usefull and it enabled me to resolve my issue.

    Thank you!


    Best,

    Inès

Sign In or Register to comment.

agen judi bola , sportbook, casino, togel, number game, singapore, tangkas, basket, slot, poker, dominoqq, agen bola. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 50.000 ,- bonus cashback hingga 10% , diskon togel hingga 66% bisa bermain di android dan IOS kapanpun dan dimana pun. poker , bandarq , aduq, domino qq , dominobet. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 10.000 ,- bonus turnover 0.5% dan bonus referral 20%. Bonus - bonus yang dihadirkan bisa terbilang cukup tinggi dan memuaskan, anda hanya perlu memasang pada situs yang memberikan bursa pasaran terbaik yaitu http://45.77.173.118/ Bola168. Situs penyedia segala jenis permainan poker online kini semakin banyak ditemukan di Internet, salah satunya TahunQQ merupakan situs Agen Judi Domino66 Dan BandarQ Terpercaya yang mampu memberikan banyak provit bagi bettornya. Permainan Yang Di Sediakan Dewi365 Juga sangat banyak Dan menarik dan Peluang untuk memenangkan Taruhan Judi online ini juga sangat mudah . Mainkan Segera Taruhan Sportbook anda bersama Agen Judi Bola Bersama Dewi365 Kemenangan Anda Berapa pun akan Terbayarkan. Tersedia 9 macam permainan seru yang bisa kamu mainkan hanya di dalam 1 ID saja. Permainan seru yang tersedia seperti Poker, Domino QQ Dan juga BandarQ Online. Semuanya tersedia lengkap hanya di ABGQQ. Situs ABGQQ sangat mudah dimenangkan, kamu juga akan mendapatkan mega bonus dan setiap pemain berhak mendapatkan cashback mingguan. ABGQQ juga telah diakui sebagai Bandar Domino Online yang menjamin sistem FAIR PLAY disetiap permainan yang bisa dimainkan dengan deposit minimal hanya Rp.25.000. DEWI365 adalah Bandar Judi Bola Terpercaya & resmi dan terpercaya di indonesia. Situs judi bola ini menyediakan fasilitas bagi anda untuk dapat bermain memainkan permainan judi bola. Didalam situs ini memiliki berbagai permainan taruhan bola terlengkap seperti Sbobet, yang membuat DEWI365 menjadi situs judi bola terbaik dan terpercaya di Indonesia. Tentunya sebagai situs yang bertugas sebagai Bandar Poker Online pastinya akan berusaha untuk menjaga semua informasi dan keamanan yang terdapat di POKERQQ13. Kotakqq adalah situs Judi Poker Online Terpercayayang menyediakan 9 jenis permainan sakong online, dominoqq, domino99, bandarq, bandar ceme, aduq, poker online, bandar poker, balak66, perang baccarat, dan capsa susun. Dengan minimal deposit withdraw 15.000 Anda sudah bisa memainkan semua permaina pkv games di situs kami. Jackpot besar,Win rate tinggi, Fair play, PKV Games