vsgImGui: How to support InputMethod? #1319
Answered
by
robertosfield
Bob-the-Git
asked this question in
Q&A
Replies: 2 comments 1 reply
-
The VSG doesn't have a "messaging mechanism".
Do you mean platform agnostic event encapsulation? It just provides a
means of encapsulating platform specific Windows/Keyboard/Mouse events.
Events are polled each frame and put into a event list than applications
can capture with event handler as is done by [vsgImGui::SendEventsToImGui(
https://github.com/vsg-dev/vsgImGui/blob/master/include/vsgImGui/SendEventsToImGui.h
)
As for InputMethod, again having to guess what you mean. In this in
context of ImGui? If so what API are you referring to? Could you provide a
code example of what you mean as I'm not an expert in ImGui and don't have
direct experience with working with Chinese characters sets.
… Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
Bob-the-Git
-
The relevant code in vsgImGui is: if (uint16_t c = keyPress.keyModified; c > 0 && c < 255)
{
io.AddInputCharacter(c);
} The c>0 && c<255 will be due to ImGui not directly handling non ascii characters, the VSG itself will be handling them. So my guess is that we just need to add some code to convert the non ascii characters to UTF-8. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, everyone!
The examples of vsgImGui don’t demonstrate how to support input methods. I’d like to know how to achieve this.
I’m trying to input Chinese characters in this text box using a pinyin input method.
There are two issues to resolve:
The effect I hope to achieve is something like this:
My current thought is that VSG needs to pass more messages to ImGui, but I don’t quite understand VSG’s messaging mechanism yet. It seems that VSG has some encapsulation in this area. If you could provide an overview of VSG’s message handling design, it would be a great help to me.
Thank you in advance!
Beta Was this translation helpful? Give feedback.
All reactions