-
-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix ImGuiKey mapping for SDL2 and SDL3 #7670
Conversation
Thanks for the PR! Where did you see that it require untranslated keys? I think we should explicitly state we try to use translate ones? |
I tried to use it with not English locale settings in my system (arch,KDE), without fix it won't work at all, only chars queue and functional keys |
You are suggesting something different now. Do you mean that you are not receiving any SDL valid key-code from SDL on those keys? |
Sure, I tried it with demo window, Keys down method not working |
Can you add some printing of all values in the event handler and confirm them for a range of keys? |
Yes, I'm pressing QWERTYUIOP:
Startup with ru:
scancode is the same so I print only SDL_Keycode sym |
Another possible workaround is to try symbols first and then scancode but you will get issues with qwertz layout
Or implement similar method like in glfw backend - ImGui_ImplGlfw_TranslateUntranslatedKey |
First check what those keycode correspond to in SDL mapping. |
I implemented ImGui_ImplSDL2_TranslateUntranslatedKey it works well but I get error when change locale at runtime Edit: figured it out |
Will open new PR with translated solution |
Since ImGui requires untranslated ImGuiKey values, we should use scancode mapping instead of symbols, as referred to in SDL2 documentation SDL_Keycode