Howdy, Stranger!

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

Supported by

[solved] Plotting multiple events

edited September 2013 in OpenSesame

Hello again :)

I am trying to get my program to recognize 2 events. First I have it plotting the xy coordinates over time from Point A to Point B. It only plots from a fixation point to the target object, but I have been trying to get it to plot the coordinates when say a participant clicks something that is not the target object.

But I can only get it to time until it hits the target object, or it it will only give me the coordinates of all clicks. I can't get it to do both.

Do you have any suggestions?

Thanks

Fiona

Comments

  • edited 5:11AM

    Gah. Nevermind.

    #note up to 25 clicks and position also every 20ms.
    while clicks < 25:
      # wait a short period for a click
      button, position, timestamp = my_mouse.get_click(timeout=20)
      if button != None:
        clicks+= 1
        x, y = position
        t = timestamp - start_t
        myLog.write(str(clicks) + ',' + str(x) + ',' + str(y) + ',' + str(t) + ',' + str(set) + ',' + str(type) + ',' + str(part) + chr(10))
        if x > (target_x - 76) and x < (target_x + 76) and y > (target_y - 80) and y < (target_y + 80):
        # Click was on the target. 
          correct_music.play()
          break
      position, timestamp = my_mouse.get_pos()
      x, y = position
      t = timestamp - start_t
      myLog.write(str(clicks) + ',' + str(x) + ',' + str(y) + ',' + str(t)  + ',' + str(set) + ',' + str(type) + ',' + str(part) + chr(10))
    
Sign In or Register to comment.