BalazsJako / ImGuiColorTextEdit

Colorizing text editor for ImGui
MIT License
1.42k stars 236 forks source link

i cant write #124

Open Kianbs opened 4 years ago

Kianbs commented 4 years ago

hi, i need help. i cant write in my textedit but i can paste every text and with backspace remove them. code: https://hastebin.com/voyaxatovu.cpp

VeithBuergerhoff commented 3 years ago

The hastebin links seems to be broken. If you have trouble setting up ImGuiColorTextEdit, you might want to take a look at the Demo or more specifically the main.cpp: ImGui::Begin("Text Editor Demo", nullptr, ImGuiWindowFlags_HorizontalScrollbar); editor.Render("TextEditor"); ImGui::End();

Notice how the Render-function takes a name for the editor window. Calling the parameter-less Render-function might not handle input, as it seems to not call the Handle...Input functions. (I am unsure if a parent window is required but I am guessing it is)

rscwn commented 2 years ago

Try calling SetHandleKeyboardInputs() and setting it to true like this:

static TextEditor editor; editor.SetHandleKeyboardInputs(true);

It fixed my issue where i couldn't type in PC or Android.

ZaneA commented 1 year ago

I had the same issue with the docking branch of ImGui (I'm assuming it's related as I had similar issues in ImGuizmo), in my case changing

if (ImGui::IsWindowFocused())

to

if (ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows))

in TextEditor.cpp (line ~698) void TextEditor::HandleKeyboardInputs() fixed input for me.