Keys not in Allowed Keys Showed Up on the Screen

My device:
macOS Mojave: version 10.14.6
PsychoPy version: 2020.2.3
Standard Standalone? Yes

What are you trying to achieve?:
The basic description of my study: Participants will see a bunch of images and study them, and then they will go to the test phase, where they will only see the apertures of the images they’ve seen before, and they will first choose they remember it or not by choosing 1 or 2, and the next page is to ask them to name the objects in the image. The problem is with the test phase.

What went wrong?:
I got the written response working. However, in one of my pilot trial, I realized that the keys not allowed (like numbers and shift) also showed up on the screen despite the fact that I have specified the allowed keys in the key response for this routine are only ‘a’, ‘b’, ‘c’, ‘d’, ‘e’, ‘f’, ‘g’, ‘h’, ‘i’, ‘j’, ‘k’, ‘l’, ‘m’, ‘n’, ‘o’, ‘p’, ‘q’, ‘r’, ‘s’, ‘t’, ‘u’, ‘v’, ‘w’, ‘x’, ‘y’, ‘z’, ‘backspace’, ‘return’, ‘space’ (image attached).

Another issue is that when I choose [1] remember or [2] do not remember in the previous routine, the 1 and 2 I chose will show up on the written response (image attached).

What did you try to make it work?:
At first, I thought maybe it’s because there’s no blank space between the two routines, so I added a blank space of 1 second, but the same thing still happened.

I have attached a sample experiment below including images and excel file, and the psyexp file. It would be wonderful if anyone would help me look at this. You might need to put all the images into a folder called practice_apertures, as it is the path I specified in my excel file.

random.psyexp (29.4 KB) !
practice_obj_aperture.xlsx (8.5 KB)


@Kuriko, I think the issue is because you have a code component for collecting key responses, but you have set your key list in the keyboard component, which is separate. Instead, you could add the keyList arg to your code component, like this:

keys = event.getKeys(keyList=['a', 'b', 'c', 'etc...'])
1 Like

Thank you so much! So the event.getKeys() is doing similar things as the keyboard component : D