psychopy.org | Reference | Downloads | Github

Mark the location where the mouse click. but it seem very difficult for us

OS (e.g. Win10):
WIN 10
PsychoPy version (e.g. 1.84.x):
PsychoPy v3.2.3
Standard Standalone? (y/n) If not then what?:
What are you trying to achieve?:
we want create a experiment which can test how much time the subjects cost to find a target in a image .
What did you try to make it work?:
Because the number of the target may be more than ones , so we want to record every times the subject’s mouse clicks time and location (x,y) in the image (it seem psychopy only can record the location in the screen not in the image) . In addition, we want to mark each click to tell the subject how many times they clicked.for example,The first time the tester clicked (0.8, 0.8), we would text’1 ‘on that marker, and the second time we would click somewhere else, where we would text’ 2’ on that marker.
What specifically went wrong when you tried that?:



when we run this program,it send this massage:

we will be appreciate if someone can help us.

Hi @brandy, this suggests there is something wrong with how the position is being set on the text. Regarding mouse positions and images, the image and the mouse positions share the same coordinates ([0,0] at the screen center), but instead of using getPressed, you can use the isPressedIn method to check whether the mouse is pressed in the image, that way you can be sure your text is placed relative to the image.

I have a similar example attached that adds numbers to an image on each mouse click. It uses minimal code (you need to download the image as well, or replace it in the image component). Press escape to end the task:

numOnImage.psyexp (7.3 KB) im

Thank for U reply! @dvbridges,we have done this problem!