Dear all,
We are preparing the fMRI experiment and we came across an issue with mouse clicks. I describe the problem below - maybe some of you have come across a similar issue and have a solution for it. If so, we’d be grateful if you could share it with us!
Best,
Ewa
OS
Win10
PsychoPy version
2022.2.4
Standard Standalone?:
yes
What are you trying to achieve?:
When we run the experiment designed in the builder mode, we want to keep track of the information appearing in the console in the other screen. However, the information is not updating by its own, only after moving the mouse cursor. It updates automatically when we click the mouse button in the console, but after doing that, some buttons don’t work in the trials, in which participants have to move a slider by pressing two C & B on the keyboard (I attach the code component below). However, these buttons work in other trials. Also, the problem with mouse clicks appears only if we use two screens to monitor the console. It does not appear with the use of single screen - in such case, the mouse is not visible at all.
We would like to introduce changes that allow for completely ignoring the mouse, so that the buttons work even if someone clicks the mouse by accident when moving the cursor in the console.
keys = event.getKeys()
if len(keys):
if ‘b’ in keys:
slider_2.markerPos = slider_2.markerPos - 0.1
elif ‘c’ in keys:
slider_2.markerPos = slider_2.markerPos + 0.1
**What did you try to make it work?:
We tried changing the code component in following ways:
-
By collecting only responses b and c from the keyboard:
keys = event.getKeys(keyList=[‘b’, ‘c’]) -
By clearing all the events currently in the event buffer.
psychopy.event.clearEvents(eventType=‘mouse’)
What specifically went wrong when you tried that?:
Nothing changed, in trials with slider the buttons C&D were still not working after clicking the mouse.