[solved] Task with touchscreen
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!
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
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 classmy_mouse = mouse(self.experiment) # create a mouse object
my_mouse.set_visible(True) # make the cursor visible
button, pos, time = my_mouse.get_click() # get a mouseclick
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
Check out SigmundAI.eu for our OpenSesame AI assistant!
Inactive, marking as solved.
Check out SigmundAI.eu for our OpenSesame AI assistant!