ocornut / imgui

Dear ImGui: Bloat-free Graphical User interface for C++ with minimal dependencies
MIT License
59.43k stars 10.12k forks source link

InputText not working #7829

Closed DanielFiddel closed 1 month ago

DanielFiddel commented 1 month ago

Version/Branch of Dear ImGui:

Version 1.91.0, Branch: master

Back-ends:

imgui_impl_win32.cpp + imgui_impl_dx12.cpp

Compiler, OS:

windows10 + msvc 2022

Full config/build information:

No response

Details:

I copied and added an 'inputtext' example from imgui_demo.cpp to example_win32_directx12.cpp. but in example_win32_directx12.cpp it doesn't work, yet works fine in imgui_demo.cpp. the line is 'static char buf1[32] = ""; ImGui::InputText("default", buf1, 32);'. I don't get any errors.

in debug log when using the input from the demo, the log shows the key press and this: "[06553] [io] Calling io.PlatformSetImeDataFn(): WantVisible: 1, InputPos (810.00,393.00)" on every key press.

but when using it from example_win32_directx12.cpp the log only shows the key presses, no 'io.PlatformSetImeDataFn()' call.

is this intended? why? what's the difference?

Screenshots/Video:

No response

Minimal, Complete and Verifiable Example code:

// Here's some code anyone can copy and paste to reproduce your issue
ImGui::Begin("Example Bug");
MoreCodeToExplainMyIssue();
ImGui::End();
ocornut commented 1 month ago

it doesn't work

Please clarify what that means.

in debug log when using the input from the demo, the log shows the key press and this: "[06553] [io] Calling io.PlatformSetImeDataFn(): WantVisible: 1, InputPos (810.00,393.00)" on every key press.

That's normal if you enabled [X] IO section in Debug Log, you can ignore.

DanielFiddel commented 1 month ago

The textbox appears in the window, but I can't input anything.

ocornut commented 1 month ago

This is not clear enough. Can you activate/focus it? Can you provide a video or gif recording of it?

What does Metrics->Internal State->Active ID says when activated?

DanielFiddel commented 1 month ago

my bad, I overwritten the 'io' variable disabling the keyboard controls, oops.