I see that you were running v. 2021.2.2. If I create a simple example using exactly the same parameters you show in the screenshot but in v. 2022.1.1, the mouse is not functioning properly. After some additional troubleshooting with the logs, Iāve discovered that the issue is that in v.2022 the mouse position is not being recorded correctly. My image is being presented in the center, but if I click there nothing happens. So I started clicking all over and when I clicked in the top right corner of the screen my trials were terminating properly. Checking the output .csv I see that clicking in the top right is being detected as a click in the center image, and clicking below that is logged as bottom left. The .csv reports x and y coordinates that match the locations of these images:
start_mouse.x | start_mouse.y | start_mouse.leftButton | start_mouse.midButton | start_mouse.rightButton | start_mouse.clicked_name |
- | - | - | - | - | - |
-0.1008929 | -0.0901786 | 1 | 0 | 0 | image |
-0.4339286 | -0.1285714 | 1 | 0 | 0 | bot_left |
-0.4303571 | -0.1241071 | 1 | 0 | 0 | bot_left |
-0.2410714 | -0.1366071 | 1 | 0 | 0 | image |
-0.2410714 | -0.1375 | 1 | 0 | 0 | image |
The log reports the mouse position in pixel coordinates and the clicked locations that triggered and end routine are clearly in the right of the screen despite the csv reporting a center image click.
> 20.1159 DATA Mouse: Left button up, pos=(1679,1019)
> 21.0299 EXP New trial (rep=1, index=0): None
> 22.9158 DATA Mouse: Left button down, pos=(1306,976)
> 23.0650 DATA Mouse: Left button up, pos=(1306,976)
> 23.9303 EXP New trial (rep=2, index=0): None
Next, I inserted code to get the mouse position at the start and end of the routine, and I used setPos to put the cursor at 0,0 at the start of every trial. Again, the positions are not correct as the cursor is showing up at 0,0 but is not reported here. Iām not sure, but I think -.8,-.5 in height units is the bottom left corner, which in pixel space is 0,0.
starting: [-0.8 -0.5]
ending: [-0.20535715 -0.11428571]
starting: [-0.8 -0.5]
ending: [-0.14285715 -0.4419643 ]
starting: [-0.8 -0.5]
ending: [-0.14107142 -0.5089286 ]
starting: [-0.8 -0.5]
ending: [-0.26875 -0.17678571]
starting: [-0.8 -0.5]
ending: [-0.34553573 -0.5339286 ]
This isnāt an artifact of using setPos, because the issue remains when I donāt use it. Here are the positions when I made all clicks in the right half of the screen in order to end the trials:
starting: [-1.0955358 -0.42232144]
ending: [-0.21160714 -0.13125 ]
starting: [-0.21160714 -0.13125 ]
ending: [-0.27767858 -0.46696427]
starting: [-0.27767858 -0.46696427]
ending: [-0.5 -0.525]
starting: [-0.5 -0.525]
ending: [-0.29910713 -0.27321428]
starting: [-0.29910713 -0.27321428]
ending: [-0.22678572 -0.16785714]
As a further test I ran the demo using version 2021.1.4 (which worked for my actual experiment) and the problem is not present. Here are the start and end positions when I click on the center, top left, bottom left, bottom right, and then top right images. Each click resulted in a end routine and I confirmed in the csv that the correct images are being logged.
starting: [-0.11339286 0.27857143]
ending: [-0.00625 -0.00982143]
starting: [-0.00625 -0.00982143]
ending: [-0.3 0.34285714]
starting: [-0.32678571 0.11517857]
ending: [-0.34821429 -0.25714286]
starting: [-0.34732143 -0.25803571]
ending: [ 0.28571429 -0.26785714]
starting: [ 0.28571429 -0.26785714]
ending: [0.32678571 0.30178571]
and the csv showing the correct responses being registered:
start_mouse.x | start_mouse.y | start_mouse.leftButton | start_mouse.midButton | start_mouse.rightButton | start_mouse.clicked_name |
- | - | - | - | - | - |
-0.00625 | -0.0098214 | 1 | 0 | 0 | image |
-0.3 | 0.34285714 | 1 | 0 | 0 | top_left |
-0.3482143 | -0.2571429 | 1 | 0 | 0 | bot_left |
0.28571429 | -0.2678571 | 1 | 0 | 0 | bot_right |
0.32678571 | 0.30178571 | 1 | 0 | 0 | top_right |
I have a linux machine that I can test this on next. But perhaps someone can try running the attached example in 2022.1.1. on a PC to see if the issue replicates.
mouse_click_demo.psyexp (20.4 KB)