Howdy, Stranger!

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

Supported by

[solved] Task with touchscreen

wazwaz
edited January 2012 in OpenSesame
Hi everybody!

I'm new to OpenSesame and my knowledge of programming is very poor. I wanted to ask for a bit of help with my experiment. Basically, I need to show a picture and 7 labels (6 fillers 1 target) . I will use a touch screen for that. How can I use mouse_response so the participant can choose one of this labels?


Thanks a lot! :)

Comments

  • edited 1:16PM

    Hi Waz,

    Welcome and thank you for your interest in OpenSesame!

    In order to determine whether a participant has clicked on (or touched) a certain object you will need to a little coding, but nothing terribly complicated. Another user already asked a similar question, and I made a simple demonstration experiment. Hopefully this will get you started.
    mouse.opensesame.tar.gz

    Basically, you need to create a mouse object in an inline_script item, get the coordinates and use these to determine which object the participant has selected. This is shown in the demonstration experiment in more detail, but here's the general idea:
    from openexp.mouse import mouse # import the mouse class<br /> my_mouse = mouse(self.experiment) # create a mouse object<br /> my_mouse.set_visible(True) # make the cursor visible<br /> button, pos, time = my_mouse.get_click() # get a mouseclick<br /> x, y = pos # get the coordinates (pos is a tuple)
    You can find a complete function list here:
    http://osdoc.cogsci.nl/python-inline-code/mouse-functions

    There's one thing that can be problematic. On some systems the mouse cursor doesn't appear (it works, but the cursor is hidden). Come to think of it, this doesn't really matter for a touchscreen, but if this becomes problematic, let me know.

    Kindest regards,
    Sebastiaan

    There's much bigger issues in the world, I know. But I first have to take care of the world I know.
    cogsci.nl/smathot

  • edited 1:16PM

    Inactive, marking as solved.

    There's much bigger issues in the world, I know. But I first have to take care of the world I know.
    cogsci.nl/smathot

Sign In or Register to comment.