Mouse region responses
in OpenSesame
How easy is it to set up region-based mouse responses in OpenSesame?
E.g. With a displayed sketchpad until a click is made in one of the specified regions, the trial is correct if you click on region1, incorrect if you click on region2
Regions defined as ellipses or rectangles.

Comments
Hi,
It is fairly easy. You have to use
mousefunctions in aninline_script. In particular, you need to take the mouse position once a click occurred and calculate the distance to the centre of your regions. If the distance is smaller than a certain threshold, you can consider this region to be chosen. If your regions are not perfect circles, it is a little harder to check whether a click was within a region or not, but works in a similar way.Good luck,
Eduard
Hi,
one plug-in that might be useful for your purpose is the mousetrap_response plug-in (https://github.com/pascalkieslich/mousetrap-os). Basically, it allows you to define rectangular regions on the screen (in the same way a rectangle is defined on a sketchpad) and classify if a mouse response has occurred in one of these regions (in other words, this is a work around to implement buttons on sketchpads). We developed these plug-ins to implement mouse-tracking in OpenSesame, but you can also just use them for the purpose you mentioned above. Feel free to ask if you are interested in using the plug-ins and have questions.
Best
Pascal