Millisecond Forums

Record multiple click position coordinates

https://forums.millisecond.com/Topic14906.aspx

By mrg4 - 11/6/2014

Is it possible to record multiple clicks on a single picture, together with the x and y position coordinates for each time?
In my task the participant has to spot one or more changes in a picture. After presenting the second picture, he is supposed to click on the respective area.

I already searched for a solution and found a similar problem here (http://www.millisecond.com/forums/Topic939.aspx?Keywords=record-click-position-coordinates) but I can't transfer the solution to my problem.

I hope someone is able to help me.

Thanks,
Dominik





By Dave - 11/6/2014

Yes, that's perfectly possible:

<values>
/ x = 0
/ y = 0
</values>

<block myblock>
/ trials = [1-2=firstpicture]
</block>

<trial firstpicture>
/ stimulusframes = [1=firstpic]
/ trialduration = 1000
/ branch = [trial.secondpicture]
</trial>

<trial secondpicture>
/ ontrialend = [if (trial.secondpicture.response != "done") {values.x = trial.secondpicture.responsex; values.y = trial.secondpicture.responsey}]
/ stimulusframes = [1=secondpic, done, coordinates]
/ inputdevice = mouse
/ validresponse = (secondpic, done)
/ branch = [if (trial.secondpicture.response != "done") trial.secondpicture]
</trial>

<text firstpic>
/ items = ("A1.jpg", "B1.jpg")
/ size = (50%,50%)
/ txbgcolor = (green)
</text>

<text secondpic>
/ items = ("A2.jpg", "B2.jpg")
/ select = current(firstpic)
/ size = (50%,50%)
/ txbgcolor = (blue)
/ erase = false
</text>

<text done>
/ items = ("DONE")
/ position = (50%, 90%)
/ erase = false
</text>

<text coordinates>
/ items = ("<%values.x%>, <%values.y%>")
/ position = (50%, 10%)
/ erase = false
</text>

<data>
/ columns = [date time subject blocknum blockcode trialnum trialcode stimulusnumber stimulusitem response latency values.x values.y]
</data>


By mrg4 - 11/8/2014

Thank you so much! It's working perfectly fine!

Regards,
Dominik