Problem with mouse and 2 monitors

OS: macOS 14.4.1 (23E224)
PsychoPy version: 2024.2.0
Standard Standalone? (y/n): Yes
What are you trying to achieve?:

I’m running an fMRI experiment on my laptop with an external monitor and need to ensure that keyboard inputs are recorded even if the experiment window is not in focus. Currently, inputs are only detected if I manually move the mouse pointer to the external monitor window and click it. This poses a risk of missing button presses if the window isn’t focused. I want to focus it automatically every time I launch the experiment.

What did you try to make it work?:

  • Set the experiment to full-screen mode.
  • Mirrored the external screen and my laptop screen.

What specifically went wrong when you tried that?:

No change detected. I can still move my mouse.

SOLVED: for other people having the same problem, I managed to get it to work by changing the keyboard backend from “ioHub” to “Psychtoolbox”.

Importantly, the script worked fine as long as I used an external keyboard. It stopped working properly when I tested the button box at the fMRI scanner.