How to display the effective key with the current keyboard?

So, I have 2 input actions for switching to the next panel and to the previous panel. So far, so good. NextPanel is bound to E and PreviousPanel is bound to Q.

But, when I switch to French Keyboard, NextPanel is still E but PreviousPanel becomes A. It’s the same key on the keyboard it’s just that French keyboard is AZERTY and English keyboard is QWERTY.

What I want to do, is to display on the status bar that the user should press Q (or A if French keyboard) to go to the previous panel. How can I do this?

            controls.PlayMenu.NextPanel.performed += nextPanel;
            controls.PlayMenu.PreviousPanel.performed += previousPanel;

Using localization won’t work flawlessly because the user might be in French locale and switch to English keyboard.

So, is there a functionality to display the effective keyboard key for the input action controls.PlayMenu.PreviousPanel?

Check out the docs.

InputAction.GetBindingDisplayString, check out the sample code in the section I linked above.

Thanks but that does not work:

            controls.PlayMenu.PreviousPanel.performed += previousPanel;
            foreach (var b in controls.PlayMenu.PreviousPanel.bindings)
            {
                Debug.Log(b.ToDisplayString());
            }

9144379--1270696--upload_2023-7-13_16-14-27.png

I want ‘A’ not ‘Q’, if I tell the users to press Q to go to previous panel they will tell me that it does not work. I guess I will use localization then, only a minority will be affected.

How about using N(ext) and P(revious). They are the same on every keyboard, I think.

That’s an interesting idea but Q & E are quite ergonomics since they are near WASD, another alternative is Insert & Pg Up, but that won’t work too well on laptops with small keyboards.