I'm running into trouble collecting keyboard inputs for two psychological tasks, a pavlovian and instrumental learning script. I'll show the instrumental script in hopes that solving the problem in the instrumental script will transfer to the Pavlovian script. I'm running on a 2018 MacBook Pro with Touch Bar, High Sierra.
What I want is for the window to close if I press escape, and during the trial loop, count the number of left, up, and right arrow keypresses so the outcome image is shown when the key is pressed nine times. But the blue window just stays on the screen and is unresponsive to keyboard input. Actually, at the moment, the script just stays stuck on the intro window with the introduction text.
Here's what I've tried:
Using KbCheck instead of KbWait
Erasing the While loop
Putting the keyboard input code at different places in the code
Using different KbNames
Using a different index for KbWait
Thanks so much for your help!