-
-
Notifications
You must be signed in to change notification settings - Fork 10.6k
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
Keyboard storage can't fit keycodes that are large #37
Comments
I've solved this issue in my code by using the SDL2 "scancodes" instead of the key codes. If anyone else is using SDL2 this is how I have it setup:
And then later I parse the events more or less like this (some code missing) case SDL_KEYDOWN:
} // |
I'll close this for now. The issue you reported is valid and still exist but until we find a library where key values cannot fit within 0..512 i don't think it is worth fixing. |
At worse one can easily store the 17 keys that ImGui use in a contiguous array and just pass that to ImGui. So instead of doing
and being unable to fill the KeyDown[] array you can do:
and fill the KeyDown[] array using ImGuiKey_* indices. The code would only be 2 lines longer to setup the keymap table with a for loop. |
Don't deserialize empty names as "\n".
mattiasljungstrom says:
"I'm using SDL2, and when I input the key mappings from SDL2 for special keys they all have very large values. This also seems to brake the internal code of ImGui. I think it assumes all key code values are between 0-255?"
The text was updated successfully, but these errors were encountered: