mirror of
https://github.com/kevinporetti/UnrealImGui.git
synced 2025-01-18 08:20:32 +00:00
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:
parent
51031d7d86
commit
0bf940de81
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user