Howdy, Stranger!

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

Supported by

Specifying mouseclick coordinate range

I'm sorry this is a very basic question. I have no programming experience. :/
In my experiment, I want the person to be able to click on one of four boxes and not be able to click anywhere else.
How do I specify a range of coordinates that are ok?
Eg. you can click between x=-224 to -288 and y=-256 to -192 for box 1; you can click between x=blah to blah and y=yada to yada for box 2, etc.

Comments

  • edited January 2017

    Hi,

    if you want to use a sketchpad to create the visual display (i.e. to draw the boxes), you could use the mousetrap_response plugin to track mouse movements and clicks, and to define regions on the sketchpad that represent buttons. The mousetrap_response plugin needs to be installed separately, which can be easily done via pip (see more information here: https://github.com/pascalkieslich/mousetrap-os). A detailed documentation of mousetrap_response plugin can be found here. [Note that the main purpose of the mousetrap_response plugin is to implement mouse-tracking, but you can also disregard the mouse-tracking data and simply use it to define buttons (i.e. "clickable regions") on the sketchpad and log which of those buttons was clicked.]

    An alternative way to define buttons in OpenSesame is by using forms - more information on forms can be found here: http://osdoc.cogsci.nl/3.1/manual/forms/custom/
    Importantly, forms have their own geometry and are defined either via OpenSesame script or Python code.

    Best regards,

    Pascal

  • Thanks so much!

Sign In or Register to comment.