in my trial loop I am trying to initialize the presentation of a visual.ImageStim (a simple .jpg) by a mouse-click, so as soon as the left mouse button is clicked, i want to draw my stimulus. It worked out fine with a keypress, but I did not manage to set the mouse click as the event trigger. In my code I tried out this:
mouse = event.Mouse() mouse_click = mouse.getPressed() def doTrial (stimuli_per_block): for x in range (len(stimuli_per_block)): event.clearEvents() if mouse_click == (0,0,0): core.wait() elif mouse_click == (1,0,0): stimuli_per_block[x].draw()
I thought by setting my variable mouse_click as mouse.getPressed(), this variable always contains the tuple of 3 elements, indicating if a button of the mouse was pressed, so I thought I could use this as a condition prior to my visual stimulus, but it does not work out. Has anyone experience with that problem in Psychopy version 1.90.3 (Python 2.7)?
Thanks for your help!