Keyboard component

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

OS (e.g. Win10): macOS Tahoe 26.3.1
PsychoPy version (e.g. 2024.2.4 Py 3.8): 2026.1.1
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 want to collect keyboard response, with Allowed Keys being ‘y’ , ‘n’, but ‘y’ is never recorded.

What did you try to make it work?: I changed allowed keys to other letter and it works. Only ‘y’ is not accepted!

Link to the most relevant existing thread you have found: -

What specifically went wrong when you tried that?:
When running, if I input ‘y’ as an answer, it records None.

Do you have any other keyboard components or keyboard code in Each Frame?

Please could you show a screenshot of your allowed keys?

In GFMT experiment my correct response is coming as 0…making my test invalid.I have practical tomorrow.Can you please help me out?

I don’t have any other keyboard components. Here are screenshots.

Another problem is that, while I have set the Allowed Keys to ‘set every repeat’, the error down there doesn’t go away: “Looks like your variable …”.

Your allowed keys should be constant - they are always ‘y’, ‘n’

Thank you, tried that too, still the same situation.

Is your keyboard QWERTZ rather than QWERTY? If so, then does the keyboard component respond to Z and then Y if you set the allowed keys to ‘z’,‘n’ ?

Yes! This solved it! Thanks so much!