Keyboard Layout on pavlovia.org incorrect detection

OS (e.g. Win10): Win10
PsychoPy version (e.g. 1.84.x): v2022.2.3
Standard Standalone? (y/n) If not then what?: y
What are you trying to achieve?:
Hi to all of you :wave:,
Currently, I am learning how to use the Builder. I just created a simple memory experiment where participants study certain words and after that are presented either those β€œold” words or new ones. For each word they need to press β€˜y’ (yes) when the word is old, otherwise β€˜n’ for no. When I run it locally the experiment detects that I am using a German keyboard (QWERTZ-layout). However, when I am piloting the experiment on pavlovia the experiment assumes a QWERTY layout, therefore I have to press β€˜z’ on my German keyboard, to actually get a β€˜y’ response. Is there any possibility or a piece of code so that the experiment can detect the keyboard layout used, because I expect participants using QWERTZ or QWERTY keyboard layouts.

A workaround would be to also allow the β€˜z’ key as response and check in a code component, whether β€˜z’ was detected as pressed key and change it to β€˜y’. However, I don’t know which side effect this may have especially for other keyboard layouts beside the ones discussed.

Any help is very appreciated :slight_smile:
Thanks
Chris

Hi @Chris2358, this seems to be a known issue with no straight-forward sollution: Keyboard coding/layout not recognized - #6 by thomas_pronk

Hi @ajus,
thanks for providing a link to that topic. As far as I understood it, there isn’t anything easy I can do, besides using the getLayoutMap (https://developer.mozilla.org/en-US/docs/Web/API/Keyboard/getLayoutMap). That would imply that just Chrome & Edge would work, which isn’t a desirable solution.

Based on that I plan on implementing the workaround I already described, see if it works and hope that it won’t have any unknown side-effects.

1 Like