Modified UImGuiInputHandler::OnKeyDown to only handle command bindings if keyboard input is not shared and to leave it for DebugExec if it is.

This commit is contained in:
Sebastian 2018-12-04 19:41:22 +00:00
parent 51031d7d86
commit 0bf940de81

View File

@ -24,13 +24,6 @@ static FImGuiInputResponse IgnoreResponse{ false, false };
FImGuiInputResponse UImGuiInputHandler::OnKeyDown(const FKeyEvent& KeyEvent) 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. // Ignore console events, so we don't block it from opening.
if (IsConsoleEvent(KeyEvent)) if (IsConsoleEvent(KeyEvent))
{ {
@ -46,7 +39,15 @@ FImGuiInputResponse UImGuiInputHandler::OnKeyDown(const FKeyEvent& KeyEvent)
} }
#endif // WITH_EDITOR #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 FImGuiInputResponse UImGuiInputHandler::GetDefaultKeyboardResponse() const