Question about tutorial demo

Hi all

I am using a macbook pro, Big Sur and an external Samsung monitor.

I am learning about PTB-3 by reading the demos. However, I have found an unexpected behavior when running the following demo: WaitFramesDemo

Everything seems to work i.e. the screen color (monitor screen, not main screen) changes every vbl + (waitframes - 0.5) * ifi) seconds.

The problem is that I cannot stop the experiment. I tried to click on any key of my keyboard (MacBook keyboard) but no luck. So, KbCheck never becomes 1.

Why is that? Can I explicitly say to KbCheck to “monitor” for input my macbook keyboard?
For now, it seems that when I click on any key on my keyboard, the keys appear in MatLab’s command window…so the external monitor is “disconnected” from my keyboard.

Thanks

this likely has something to do with the mac os security features (or whatever its called exactly), search this forum as its come up a few times before, also recently