From 0bf940de8197685489c66a4ee94ea966dca524bc Mon Sep 17 00:00:00 2001 From: Sebastian Date: Tue, 4 Dec 2018 19:41:22 +0000 Subject: [PATCH] Modified UImGuiInputHandler::OnKeyDown to only handle command bindings if keyboard input is not shared and to leave it for DebugExec if it is. --- Source/ImGui/Private/ImGuiInputHandler.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Source/ImGui/Private/ImGuiInputHandler.cpp b/Source/ImGui/Private/ImGuiInputHandler.cpp index bef0d9d..5f1b089 100644 --- a/Source/ImGui/Private/ImGuiInputHandler.cpp +++ b/Source/ImGui/Private/ImGuiInputHandler.cpp @@ -24,13 +24,6 @@ static FImGuiInputResponse IgnoreResponse{ false, false }; FImGuiInputResponse UImGuiInputHandler::OnKeyDown(const FKeyEvent& KeyEvent) { - // If this is an input mode switch event then handle it here and consume. - if (IsToggleInputEvent(KeyEvent)) - { - ModuleManager->GetProperties().ToggleInput(); - return GetDefaultKeyboardResponse().RequestConsume(); - } - // Ignore console events, so we don't block it from opening. if (IsConsoleEvent(KeyEvent)) { @@ -46,7 +39,15 @@ FImGuiInputResponse UImGuiInputHandler::OnKeyDown(const FKeyEvent& KeyEvent) } #endif // WITH_EDITOR - return GetDefaultKeyboardResponse(); + const FImGuiInputResponse Response = GetDefaultKeyboardResponse(); + + // With shared input we can leave command bindings for DebugExec to handle, otherwise we need to do it here. + if (Response.HasConsumeRequest() && IsToggleInputEvent(KeyEvent)) + { + ModuleManager->GetProperties().ToggleInput(); + } + + return Response; } FImGuiInputResponse UImGuiInputHandler::GetDefaultKeyboardResponse() const