diff --git a/engine/core/src/debug.cpp b/engine/core/src/debug.cpp index 7925b27..2007b73 100644 --- a/engine/core/src/debug.cpp +++ b/engine/core/src/debug.cpp @@ -250,9 +250,17 @@ void draw_console() { ImGui::Text("%s", prism::log_output.c_str()); static std::string console_input; - ImGui::InputText("##console_input", &console_input); - if(ImGui::Button("Input")) { + ImGui::SetNextItemWidth(-1.0f); + + const bool input_return = ImGui::InputText("##console_input", &console_input, ImGuiInputTextFlags_EnterReturnsTrue); + + if(input_return) + ImGui::SetKeyboardFocusHere(-1); + + const bool button_return = ImGui::Button("Input"); + + if(input_return || button_return) { prism::console::parse_and_invoke_command(console_input); console_input.clear(); } diff --git a/engine/core/src/input.cpp b/engine/core/src/input.cpp index 5ee2844..90362f0 100755 --- a/engine/core/src/input.cpp +++ b/engine/core/src/input.cpp @@ -174,5 +174,8 @@ bool input_system::get_allowable_text_button(unsigned int keycode) const { if(platform::get_keycode(InputButton::Backspace) == keycode) return true; + if(platform::get_keycode(InputButton::Enter) == keycode) + return true; + return false; } \ No newline at end of file