I am trying to implement an adjustment task with a dot is presented on the screen. Depending on mouse movement, the dot continuously rotates around an imaginary circle. When observers have chosen the location they want, they click and the exp goes to the next trial.
So far, I have achieved something similar, but with the keyboard. Depending on the left/right key, the dot rotates around an imaginary circle. When observers have chosen the location they want, they press Spacebar and the exp goes to the next trial.
Does anybody know how to implement this mouse adjustment task?
I managed to record mouse location but I have no idea of how to link it to my stimulus:
mousePos = tuple(mouse.getPos()) # Get mouse coordinates
if keyState[key.LEFT]: Start_Line.ori -= 1 line1Response-=1 angle+=1 #increase angle if LEFT if keyState[key.RIGHT]: Start_Line.ori += 1 line1Response+=1 angle-=1 #increase angle if RIGHT if keyState[key.SPACE]: line1Response = Start_Line.ori orResponse = angle AdjTime=clock.getTime() notFinished=False #breaks the loop and saves response if keyState[key.ESCAPE]: core.quit() Start_Line.draw() angleR = math.radians(angle) xStart = math.cos(angleR) * radius yStart = math.sin(angleR) * radius Dot_Start = visual.Polygon( win=win, name='Dot_Start',units='deg', edges=40, size=(.5, .5), ori=0, pos=[xStart,yStart], lineWidth=1, lineColor=[1,1,1], lineColorSpace='rgb', fillColor=[1,1,1], fillColorSpace='rgb', opacity=1, depth=-6.0, interpolate=True) Dot_Start.draw() #draw dot at new location win.flip()