Howdy, Stranger!

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

Supported by

.on_mouse_click()- function

edited November 2018 in OpenSesame

Dear all,

I am struggling getting my old code-snippet to work in OS v3.2. Thus my question: Does the function .on_mouse_click() still work in the new OS version?

I have two empty text input fields. My aim is to set the cursor automatically in the first text input field. Participants should give their answer and press enter to confirm it. When the answer is given (var.response_A), the cursor should jump automatically into the second text input field so that participants can enter their answer in the second field and confirm it once again with enter.

This is the code-snippet which worked in the past but does not work any more in OS v3.2:

# Execute form and activate second text_input field 
 form._exec(focus_widget = input1)
 if var.response_A != "":
     input2.on_mouse_click((0,0))

Can you help me with this question?

Thanks a lot!

Best,
Sabry

Comments

  • edited November 2018

    Hi Sabry,

    What is the error message? And what kind of object is input2?

    Eduard

    Buy Me A Coffee

  • Hi Eduard,

    well, there is no error message. I only know that the code worked in the former OS version as described above, but in the new one it does not work that way any more. Specifically, in the new OS version, one has to click with the mouse in the first text field to set the cursor there in order to enter the answer. To get the cursor in the second text field, one has to click with the mouse in the second field. Than one can press enter to confirm the answers. Object input1 and input2 are text_input widgets which I defined beforehand:

    input1 = widgets.text_input(form, return_accepts=True, var=u"response_A", text= " ")
    input2 = widgets.text_input(form, return_accepts=True, var=u"response_B", text= " ")

    Best,
    Sabry

  • Hi Sabry,

    I think some parts of the input form has changed recently, but which exactly I don't know. Specifically, whether, the on_mouse_click function still works. Can you share (a simplified version of) your experiment here, then I'll have a look whether I can make it behave like you want it.

    Best,

    Eduard

    Buy Me A Coffee

  • Hi Eduard,
    here is the very simplified version. Thank you a lot!

    Best,
    Sabry

  • Hi Sabry,

    looking at the code, I realize that this code can't work, really. Once a formed is executed you can't change settings inside the form without executing the form again. So after your call form._exec(), the focus can't be changed anymore. But maybe I am also misunderstanding the problem. I realize it would be more useful to see the behaviour in the old version. Anyway, from looking at the github code for this on_mouse_click() function, it seems that it is not defined for text input widgets. So, bad news I guess.

    Sorry.
    Eduard

    Buy Me A Coffee

  • Anyway - thanks for your effort, Eduard!

    Best,
    Sabry

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