Closed JD31 closed 9 months ago
Keys and Characters are different concepts. A regular backend when you press Z would send both a io.AddKeyEvent(ImGuiKey_Z, ...)
event and a AddInputCharacter('Z')
. You are likely to need to send characters if you want them to be listened to by an InputText()
widget.
I have a simple InputText that I want to interact with with the keyboard.
I'm not sure what this means and we may not be providing you the best answers if we don't understand what you are trying to do.
I have my own cross-platform window system (WE don't use sdl or glfw). The rendering backend is webgpu (dawn based), and dear imgui works perfectly well for rendering. I connected with succes mouse events between our window system and dear imgui. Now I am connecting the keyboard events. My thoughts (wrong with the lights you gave before) was that using the keycode based api would be enough. I understand I need to feed as well the character based api. Doing this works. Thank you.
Version/Branch of Dear ImGui:
v1.89.9
Back-ends:
WebGPU
Compiler, OS:
msvc2022 or Emscripten
Full config/build information:
No response
Details:
I have a simple
InputText
that I want to interact with with the keyboard.I am able to push events with
AddInputCharacter()
(for exampleAddInputCharacter('Z')
).But I would like to use the key based API but I don't manage to make it run (
io.AddKeyEvent(ImGuiKey_Z, down)
does not send anything to the text field)Screenshots/Video:
No response