Hey,
I’m using the new Input System v. 1.7.0 and my controls are freely configurable in the settings of the game.
All works as it should, but the keyboard keys are not localized.
My Code:
InputBinding inputBinding = inputActionReference.action.bindings[bindingIndex];
string controlName = inputBinding.ToDisplayString();
textBindingDisplayText.text = inputBinding.ToDisplayString();
ToDisplayString() is always returning the US keyboard key.
After some searching, I found the following (source: New Input System - Which keyboard layouts are supported? )
Keyboard.current.aKey.displayName;
This delivers the correct local key. I tested with German, Español and Russian. It takes the keyboard layout which is used in Windows (not yet tested on Mac or Linux).
My question now is, how do I get from the InputBinding => KeyControl? Any idea?