External keyboard on PC

If this template helps then use it. If not then just delete and start from scratch.

OS (e.g. Win10): Win10
PsychoPy version (e.g. 2024.2.4 Py 3.8): 2024.2.4
Standard Standalone Installation? (y/n) If not then what?: y
Do you want it to also run online? (y/n) n
What are you trying to achieve?: I got an experiment file from a collaborator that requires key responses of ‘2’, ‘3’, or ‘4’ and we are running this on a PC laptop. The experiment works with the keys from the internal keyboard, and it responds to ‘Enter’ and ‘Esc’ pressed on an external keyboard connected via USB. However, while running the experiment, it does not respond to ‘2’, ‘3’, or ‘4’ from the external keyboard. The collaborator who wrote this used PsychoPy Builder on a Mac, and they aren’t having this issue, and do not know how to fix this.

What did you try to make it work?: I am able to enter numbers for Participant ID and Task in PsychoPy using the external keyboard, and they keys are detected in other programs on that laptop, so the keyboard connection to the laptop seems to be fine. I’ve checked the experiment settings for Input, and when it’s set to ioHub or PsychToolbox, the internal keyboard works, but the external one does not. With Input set to Pyglet, neither keyboard works, including ‘Esc’.

Link to the most relevant existing thread you have found: Current Designs Button Box Issue

What specifically went wrong when you tried that?: As described above, changing these settings did not fix the problem. I’ve also tried adding Button Box to the experiment in builder underneath the Keyboard as an alternate input, and that didn’t work. Within the keyboard settings, I’ve also tried changing the “Register keypress on…” from “press” to “release”, and that did not solve the problem either.

Also, I’m new to PsychoPy, so not sure if this is relevant, but while the experiment is running, the Stdout feed says: 26.4515 WARNING Stopping key buffers but this could be dangerous ifother keyboards rely on the same.

The keyboard responses for a numeric keypad are “num_2”, “num_3”, etc. To check, you can see what appears in the data file if allowed keys is blank or try this: