event.waitKeys() causing freezing issues

Hi @sol, thanks for your response. Unfortunately, I don’t think that workaround is a solution for us. We also need this waiting functionality when running the script without access to an eyetracker (the eyetracker code is conditional for this reason, determined by an initial GUI menu). I did attempt to test this by trying to simulate the eyetracker via the configuration code, but it looks like you still need to be physically connected to an eyetracker for that to work.

Apart from that, this may not help solve the issue as we do need to collect responses during the experiment (done via event.getKeys()), so the window is losing focus, I think we would need a way to prevent that or re-focus the computer to the program window. Also, is it typical that losing focus from the window should spike the CPU and freeze the program? Hypothetically if the program lost focus, we could click on the window again to re-focus, but instead it instantly freezes.

We did suspect that maybe the peripheral hardware (keyboard-mouse, eyetracker ethernet) or background software was causing the program to lose focus, so we disconnected all hardware from the laptop and closed all background processes, but the program still has a chance to freeze. Do you have any other ideas about how we can fix this problem?