Howdy, Stranger!

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

Supported by

mouse response is not logging

Hi,

I made a script in which a canvas and sound are presented. Participants must click with the mouse on images that represent the sound played.

But in the logger file i can't find the coordinates of the mouse when clicked, neither the response time.
I initialize the mouse with that code :

from openexp.mouse import mouse
my_mouse = mouse(exp)
resp, position, time = my_mouse.get_click(timeout=5000)

Did I forgot something to track the response time and the coordinate of the click ?

Thanks

Comments

  • Hi Osmose,

    When you save variables in the var object they are saved in your output by the logger item. So var.resp etc. should work (assuming you have a logger item somewhere after that in your sequence).

    Best,
    Jarik

  • Hi,

    thanks for the answer, but i'm not sure I get it. I do have a logger item after in the sequence after my script, but the mouse click position (in x and y) and the response time is not in the var object as I didn't defined it in a loop. I thought that when I create a mouse in the script, all the variables that could be linked to it (click, response time etc) would be saved in the logger. In fact, there are variables called cursor_x and cursor_y but it is written " NA " in it instead of a value.

    So my question is how to fix that ?

    Thanks

  • Hi,

    So instead of:
    resp, position, time = my_mouse.get_click(timeout=5000)
    You want to use:
    var.resp, var.position, var.time = my_mouse.get_click(timeout=5000)

    there are variables called cursor_x and cursor_y but it is written " NA " in it instead of a value

    These variables are coming from some other part of your experiment.

    Best,
    Jarik

  • Hi Jarik,

    thanks for you answer. I tried it but it still doesnt work, I'm afraid I don't understand the use of the " var.something " I guess i didnt explain well my problem, i give it another try.

    when I used this line : resp, position, time = my_mouse.get_click(timeout=5000)

    it gave me the position of a mouse click but not the time since the sampler has began with the first click(which I want), but the time since the software is open.

    Just to give you a real overview of the architecture I need :

    1) Images are displayed by on a canvas
    2) a click on the center of the canvas should :
    a) Start the sampler
    b)Start the count for the mouse response, waiting for a second click to stop it.
    3)an answer by a mouse click that :
    a) stop (and reset ?) the count. From this click, I need the position of the click and the mouse time response (i.e the time between the first and second click)
    b) stop the sampler

    And finaly, it should continues to other trials.

    If you have any idea, please tell me :smiley:

    Otherwise, I will try it with a mouse response item, and will stop the sampler myself with the BARSPACE while the participants run the experience.

    Thanks,

    Robin

  • Hi Robin,

    it gave me the position of a mouse click but not the time since the sampler has began with the first click(which I want), but the time since the software is open.

    OK I understand. All items including the sampler item have a time variable which holds their onset. So assuming your sampler item is named "new_sampler" means var.time_new_sampler holds the onset time (i.e. the sound start time).

    So after:
    var.resp, var.position, var.time = my_mouse.get_click(timeout=5000)
    You could do:
    var.CalculatedSoundRT = var.time - var.time_new_sampler

    Does this help?

    Jarik

  • Hi Jarik,

    thanks again for your answer. It still doesnt work.. I got a message error : "The variable 'time_my_sampler' does not exist ".

    As I said I'm a beginner in python and opensesame, so I don't get all the subtilities, my bad.

    I'm actually doing my exp as I said above (with spacebar and a touch response), hope this gonna be ok.

    Thanks a lot for your time and answers Jarik :smiley:

  • Hi,

    Osmose:

    I got a message error : "The variable 'time_my_sampler' does not exist ".

    Jarik:

    var.CalculatedSoundRT = var.time - var.time_new_sampler

    Spot the difference...

    Eduard

    Buy Me A Coffee

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