Skip to content
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

unicode inputChar support for imguiBeginFrame #1756

Merged
merged 1 commit into from
May 6, 2019

Conversation

cloudwu
Copy link
Contributor

@cloudwu cloudwu commented May 6, 2019

I'm writing a bgfx imgui lua bindings, and I found imguiBeginFrame only support ascii char now.

This PR add a unicode inputChar support by io.AddInputCharactersUTF8.

btw, I include <dear-imgui/imgui_internal.h> because I use the internal function ImTextStrToUtf8. I'm not sure is there any equivalent function in bx. (Converting a unicode code point to utf-8 string)

@bkaradzic bkaradzic merged commit 3266469 into bkaradzic:master May 6, 2019
@cloudwu
Copy link
Contributor Author

cloudwu commented May 7, 2019

I submit a PR to imgui today, ocornut/imgui#2541 .

We can use AddInputCharacter for full unicode code point later (After the PR merged) .

btw, I found the same issue for WM_CHAR in bgfx https://github.com/bkaradzic/bgfx/blob/master/examples/common/entry/entry_windows.cpp#L843-L861

The _wparam of WM_CHAR is UTF-16, we should handle the surrogate here, because some code point will be encoded into two WM_CHAR messages. There is a similar issue : SFML/SFML#366

@bkaradzic
Copy link
Owner

You can send PR for entry_windows issue. I don't really know what should be done. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants