Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

Mouse region responses

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

  • edited August 2016

    Hi,

    It is fairly easy. You have to use mouse functions in an inline_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

    Buy Me A Coffee

  • edited August 2016

    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

Sign In or Register to comment.