[solved] mouse response images and shapes
Hello,
I am new to Opensesame and have a few problems. I'm trying to figure out a way to record mouse/joystick responses based on images and shapes on the sketchpad. I am using Opensesame .27.
Basically, subjects see a math problem either using numbers (text on a circle, ex 5 + 4) or dot arrays (bmp file, ex picture of 5 dots + picture of 4 dots) for 2 seconds then another sketchpad for 4 seconds showing 5 answer choices in the same format of either a circle with text or picture of dots, arranged in a circle around screen.
I would like to make it so the mouse click on the image or circle is recorded according to the circle or image file. I assume the best way to do this for the picutres in the dot condition is with widgets using something like:
widget 0 0 1 1 image_button path='5+4_9.bmp' var='response'
Where do I put this and is it possible to use a variable rather than specifying the exact file (ie 5+4_9.bmp)?
For the condition showing numbers written on shapes, do I need to create image files for all of these rather than using the shapes and text on the sketchpad or is there a way to make these shapes a widget?
Also, with the timing, is it possible to not have the trial end when a response is made so that the answer choices are displayed for 4 seconds (or some intermediate screen is shown for the duration of the 4 seconds) regardless of how quickly the subject responds?
Sorry for the very basic questions- perhaps I am missing something quite simple.
Thanks!
Comments
Hi Elizabeth,
You can drag a form_base plug-in into your experiment and click on the edit script button in the top right of the tab. Then you can edit the script as explained here. To use variables rather than static values, you can do things like (note the [square brackets]):
For more information about using variables, see this article.
Well, that kind of depends on how you want to implement this.
Sure, you could add an advanced_delay plug-in to the end of the trial_sequence. Or do you mean that you want the response buttons to stay on the screen for a fixed amount of time, regardless of when the response is given?
Hope this helps a bit, and let us know if you have any more questions!
Cheers!
Check out SigmundAI.eu for our OpenSesame AI assistant!
Thank you, I think I may just log the mouse coordinates. Will these be the same as seen on the sketchpad? Do they change depending on screen resolution? (sorry, coming from biology side of neuroscience so some of the experiment creation, stimulus display is very new to me : )
Hi Elizabeth,
No. Mouse coordinates have their origin (0,0) at the top left corner, whereas for sketchpads (0,0) is the center.
The size one pixel (the unit of both the mouse and the sketchpad coordinates) refers to does not change depending on the resolution. But the way you will have to convert the location of the stimulus to the mouse coordinates (or vice versa) does.
For example, for a display with a resolution of 1024 x 768 the center is at (512,384), whereas for a 1280 x 1024 display the center is at (640,512). Does that make sense?
I hope this helps. Please let us know if you have any more questions!
Best,
Lotje
Did you like my answer? Feel free to
Excellent, thank you! Everything is working well except that occasionally there is a negative x-value for the mouse coordinates...if the origin is at the upper left corner, why would there be a negative x-value?
Thanks!
Hi Elizabeth,
Are you using the PsychoPy back-end for your experiment? I forgot to mention that with PsychoPy (0,0) is at centre for the mouse coordinates. But in contrast to the sketchpad item, coordinates above centre are negative.
If you're not using the PsychoPy back-end the mouse coordinates shouldn't be negative. So if this is the case, perhaps you could provide us with some more information about your experiment, for example by uploading the script?
Best wishes,
Lotje
Did you like my answer? Feel free to
Hi Lotje,
I was using PsychoPy as the back-end and actually still didn't get negative coordinates and checked everything (assuming 0,0 was at the top left) and it worked perfectly. I switched to xpyriment back-end due to some issues with OpenGL on the exp. computer, and it still works. I am not sure why it was working with the PsychoPy back-end though. That's a bit strange.
Thank you for the update, I'll check again but I think its working fine.
Hi Elizabeth,
I think we figured it out! PsychoPy indeed uses the notation as described earlier, but for the sake of consistency between backends, the psycho backend in OpenSesame then converts this to coordinates with their origin at the top left.
This all works well, except when the actual resolution of the screen does not correspond to the resolution as specified in the experiment. When this happens, (0,0) is the top left of the "screen" in the real screen.
More schematically, this looks like this:
Could that explain your earlier experience with the negative values?
Best wishes,
Lotje
Did you like my answer? Feel free to
Yes, that does explain the negative values when the outer edges were clicked (but not for the images where subjects were supposed to click), which was with the PsychoPy back-end. That explains it : )
Thank you so much for your help, I really appreciate it!