From 7a23493dccaa1fd036dcab81c3c49464a02ee412 Mon Sep 17 00:00:00 2001 From: mahlemiut Date: Tue, 14 Jun 2016 22:30:08 +1200 Subject: [PATCH] debugimgui: if console window is active, then give console input widget focus. Note that this means that the disassmbly view in the console cannot get focus at all (but separate disasm windows still can). --- src/osd/modules/debugger/debugimgui.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/osd/modules/debugger/debugimgui.cpp b/src/osd/modules/debugger/debugimgui.cpp index fe2567b07ac..81f13926376 100644 --- a/src/osd/modules/debugger/debugimgui.cpp +++ b/src/osd/modules/debugger/debugimgui.cpp @@ -954,6 +954,8 @@ void debug_imgui::draw_console() ImGui::PushItemWidth(-1.0f); if(ImGui::InputText("##console_input",view_main_console->console_input,512,flags)) view_main_console->exec_cmd = true; + if ((ImGui::IsRootWindowOrAnyChildFocused() && !ImGui::IsAnyItemActive() && !ImGui::IsMouseClicked(0))) + ImGui::SetKeyboardFocusHere(-1); // Auto focus previous widget ImGui::PopItemWidth(); ImGui::EndChild(); ImGui::End();