Is there a way to map input to a physical position of the keys for users with different keyboard layouts?

How would I handle mapping actual keys on a position of the keyboard, ignoring whatever letter is on it?

Let’s say I map W A S and D to the standard movements.
Someone using a different keyboard layout where W A S and D have entirely different position would be unable to play the game properly without remapping every key first.

Is there a way to map to a physical position of the keys?

No. I’m afraid we don’t have any support for such a system. To my knowledge there is no particularly easy way to do this without encoding each keyboard’s layout, something we don’t intend to do.

So, just out of curiosity at this point, what is the preferred way of handling keyboard layout internationalization in a shipping title?

rebindable keys + a picture of a US layout with the used keys highlighted. A bit clunky, but works.

I know this is a very old post, but this is still a feature that would be amazing to have. I know that other game engines (godot) have options for mapping input to a character or the physical location of a button. As someone who uses Dvorak, starting a game that was made in unreal is a pretty bad experience.

1 Like

Both Unity and Godot (as Doodlebrisk mentioned) support it now. The latter is open source so you can check how they’re doing it, they must have a list of keyboard layouts indeed, but that should be much more feasible than a list of all gamepad devices (Godot itself still fails to recognize some Nintendo-like controllers and swaps A-B, X-Y!).

Interestingly, Unity took the decision to use physical layout by default (it means what you see only makes sense for your current layout at the moment you input it), see New Input System - Which keyboard layouts are supported? - Unity Engine - Unity Discussions, with an option to use By Character Mapped to Key (makes sense for things like Ctrl/Cmd+Q to quit or Ctrl+A to select all in an in-game editor).

Anyway, this seems to affect many games since devs have no obvious way to support “universal” WASD motion. I’m just playing a game now while also regularly switch between English and French keyboard layout to write comments vs technical stuff, and I keep having my character stuck in place. Fortunately in “normal usage”, on a commercial release, we often have mappable input so player can pick their layout mapping once and for all. Many jam games don’t have mappable input, though.