Detecting keyboard type (i.e., not QWERTY) in PsychoJS

URL of experiment:
My first time posting so I’m not sure what this refers to. Does this require my experiment be public on Pavlovia? I’m happy to share this once I understand what I need to share.

Description of the problem:
I am trying to run a French typing experiment and some ppts use an AZERTY keyboard while others use a QWERTY one. I am struggling to get my experiment to detect which type of keyboard is being used. The experiment works fine for QWERTY keyboards, but if the ppt has an AZERTY one the key presses still register as though it were QWERTY (e.g., when ‘a’ is pressed on the AZERTY layout, it registers as a ‘q’).

I have been able to replicate the problem on my own end by changing my own local keyboard and changing the language of my Chrome browser. Even when I make these local changes, the online experiment still responds as though I am set to QWERTY.

Does anyone know how I can get PsychoJS to detect the keyboard type?

What I did when faced with this issue is asked the participant to press the A key to continue on the first screen. By checking which key was recorded I knew which keyboard they were using and could adjust a later routine to suit.

Thank you for your reply! I am also doing this in my experiment but no matter what language is set to my local keyboard, it always registers ‘a’ in the QWERTY location. Even when I set my local keyboard to AZERTY it still only takes the QWERTY location of ‘a’ as an ‘a’.

This method you suggest is great for detecting what PsychoJS thinks the keyboard is. The issue seems to be that PsychoJS is not picking up what the keyboard is at all, and treats all keyboards like QWERTY ones.