How to ignore the mouse clicks during the experiment

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!



PsychoPy version

Standard Standalone?:

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:

  1. By collecting only responses b and c from the keyboard:
    keys = event.getKeys(keyList=[‘b’, ‘c’])

  2. By clearing all the events currently in the event buffer.

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.