Can I ensure the position of keyboard controls remains constant across international keyboard layouts?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By JTE

I want to make a classic-style game which uses arrow keys for directional movement and Z, X for the “A button” and “B button”.

The problem is, I have friends who use QWERTZ keyboards, so the Z key is suddenly two rows away from where I expect it to be on my QWERTY keyboard. I thought the point of scancodes was that they don’t change with the keyboard layout?? Is the engine using keycodes instead and just calling them scancodes?

Normally this would be “solved” by adding a keyboard configuration screen to allow players to remap the input themselves individually, but I still want to have a good “default” layout. Is that even possible? How would I determine the physical keyboard layout in GDscript in order to remap the inputs to be appropriate?

:bust_in_silhouette: Reply From: JTE

Ah. I see this is already a pull request. Fix non-latin layout scancodes on Linux, adds access to physical scancodes. by bruvzg · Pull Request #18020 · godotengine/godot · GitHub