Howdy, Stranger!

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

Supported by

[solved] Mouse questions

edited January 2013 in OpenSesame

Hi I have a couple of questions about mouse responses.

  1. I want to limit mouse responses to a specific area within the sketchpad. How con I do this?
  2. There is a possibility that the study is done in multiple sites that maybe have computers with different resolutions. Is the position from mouse-clicks going to be recorded different in different computers with different resolutions?

Thanks for the help!

Comments

  • edited January 2013

    Hi,

    To allow mouse responses only in a certain area of the display you will need a little bit of inline coding. The following scripts should give you an idea of how to achieve this. Simply put the scripts in the Prepare phase and the Run phase tab of an inline_code item respectively:

    Prepare phase:

    [pastebin:hTpUQtLy]

    Run phase:

    [pastebin:xZECi2rL]

    With regard to your question about screen resolutions I would like to refer you to a previous thread (especially the last couple of posts):

    Did you like my answer? Feel free to Buy Me A Coffee :)

  • edited 6:16AM

    Thank you very much!
    This helped a lot
    I have a couple of questions though:

    1a. If I leave the mouse_response item it seems I need 2 clicks to get a response. To solve this I got rid of the mouse_response and got the position and time from the my_mouse.get_click() data.
    However, by getting rid of the mouse_response I loose the option to flush extra clicks.
    I typed my_mouse.flush() at the end of the inline script but that didn't work.

    1b. I collected RT as mouse_timestamp - self.get('time_my_sketchpad')
    Does this sound right?

    1. I would like to set the mouse in the middle of the screen at the beginning of each trial how can I do that?
  • edited 6:16AM

    Hi,

    If I leave the mouse_response item it seems I need 2 clicks to get a response.

    To clear all pending output you should call the flush() function before the get_click() function. This is exactly how the mouse_response item works as well. So:

    my_mouse.flush()
    button, position, timestamp = my_mouse.get_click()

    If this does not solve your problem, perhaps your program is waiting for a mouse response twice? For example because you also appended a mouse_response item to your sequence, or because the duration of a sketchpad is set to 'mouseclick'? This is not necessary, because the response is already collected via your inline script.

    I collected RT as mouse_timestamp - self.get('time_my_sketchpad') Does this sound right?

    Yes, it does!

    I would like to set the mouse in the middle of the screen at the beginning of each trial how can I do that?

    To achieve this you will have to communicate directly with PyGame. Note that the following script is will therefore only work with the PyGame and Expyriment back-ends, and not with PsychoPy.

    [pastebin:ePQVJEfP]

    I posted a small example experiment here (simply download and save with the extension '.opensesame'):

    I hope this helps. Please let us know if you have any further questions!

    Best,

    Lotje

    Did you like my answer? Feel free to Buy Me A Coffee :)

  • edited 6:16AM

    Thanks worked great!

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