santaclose / ImGuiColorTextEdit

Colorizing text editor for ImGui
MIT License
69 stars 19 forks source link

Use ImGuiKey_LeftBracket instead of '[' #2

Closed jminor closed 1 year ago

jminor commented 1 year ago

This fixes calls to ImGui::IsKeyPressed() to use ImGuiKey_XXX constants instead of character literals so that the library compiles against recent versions of Dear ImGui.

sphaero commented 1 year ago

please merge this! :+1

sphaero commented 1 year ago

I you can please also update ImGuiKey_KeypadEnter

@@ -951,7 +951,7 @@ void TextEditor::HandleKeyboardInputs(bool aParentIsFocused)
                        SelectAll();
                else if (isShortcut && ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_D)))
                        AddCursorForNextOccurrence();
-               else if (!IsReadOnly() && !alt && !ctrl && !shift && !super && (ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_Enter)) || ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_KeyPadEnter))))
+        else if (!IsReadOnly() && !alt && !ctrl && !shift && !super && (ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_Enter)) || ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_KeypadEnter))))
                        EnterCharacter('\n', false);
                else if (!IsReadOnly() && !alt && !ctrl && !super && ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_Tab)))
                        EnterCharacter('\t', shift);