Howdy, Stranger!

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

Supported by

[open] Visual world paradigm

edited March 2013 in OpenSesame

Hi!

I want to implement sth very similar to Hunter's (http://forum.cogsci.nl/index.php?p=/discussion/351/mousetracking-and-visual-world-paradigm/p1) so, I have a fixation dot and I want them to click ON the dot, which would then be followed by a sketchpad with four pictures. I am asking them to click on of the pictures.
So, everything looks beautiful, only, the procedure is not restricted (as it should) only on the points of interest. That is,clicking to any part of the screen will make the phase go to the next step.

I know it is trivial. but i can't see where the problem lies..

Thank you in advance,
Sophia

Comments

  • edited 3:12PM

    Hi Sophia,

    If you are not interested in the trajectory of the mouse, it would be easier to use forms with image_button widgets. But since you generally are interested in the trajectory in the visual world paradigm (?), let's see how you can prevent the click from being accepted when it's on an invalid area of the screen.

    Basically, the trick is to check the coordinates of the clicked position against a list of pre-specified valid coordinates, i.e. the coordinates of your images. The principle is illustrated in the script below, which you can combine with the more elaborate script that Hunter posted.

    from math import sqrt
    from openexp.mouse import mouse
    
    # Create a mouse object
    my_mouse = mouse(exp, visible=True)
    
    # Create a list of x,y tuples that correspond to clickable coordinates
    clickableList = [ (100, 100), (512, 384) ]
    
    # The maximum distance that clicks can be from one of the coordinates 
    maxDist = 100
    
    # Go into a loop
    while True:
    
        # Get the cursor position
        position, timestamp = my_mouse.get_pos()
        x, y = position
    
        # See which buttons are pressed
        lclick, mclick, rclick = my_mouse.get_pressed()
    
        # If the left button is pressed
        if lclick:
    
            # Assume that the click is not valid
            clickValid = False
    
            # Walk through all clickable coordinates
            for vX, vY in clickableList:
                # Use Pythagoras to see how far we have clicked from
                # this coordinate ...
                d = sqrt((x-vX)**2 + (y-vY)**2)
                # ... and if close enough decide that the click is 
                # valid!
                if d < maxDist:
                    clickValid = True
    
            # If one of the clicks was valid, break!
            if clickValid:
                break
    

    Hope this helps, and good luck!

    Cheers,
    Sebastiaan

  • edited 3:12PM

    Thank you!
    I'll try it out!

    ~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