Record mouse position when mouseclick
Hi!
It's not clear to me how can I record in the log file the mouse cursor position when the mouseclick is given for a response. I'm using the get response mousetrap_response plug-in.
Can someone help me?
Thanks!
Fabio
Comments
Hi Fabio,
the mousetrap_response plugin continuously records mouse positions and stores them as lists in the variables timestamps_[item_name], xpos_[item_name] and ypos_[item_name]. That is, if the item is called get_response, they are called timestamps_get_response, xpos_get_response and ypos_get_response.
If you are only interested in the position at the click on the response button, this would be the last item of each list. If you would like to store this in a new variable, you could do this by adding an inline script directly after the get_response item and putting the following code in the run phase:
var.xpos_last_click = var.xpos_get_response[-1] var.ypos_last_click = var.ypos_get_response[-1]Note that an alternative way to implement this (if you do not care about continuous mouse-tracking and are comfortable writing a little bit of Python code) is by using OpenSesame's mouse class which is documented here:
http://osdoc.cogsci.nl/3.1/manual/python/mouse/
However, this does not provide you with the option to specify button areas on the screen.
Best,
Pascal