IDI-Systems / UnrealImGui

Unreal plug-in that integrates Dear ImGui framework into Unreal Engine 4/5.
MIT License
121 stars 27 forks source link

Issue with keys and mouse capture #9

Open daveratti opened 7 months ago

daveratti commented 7 months ago

After upgrading to this fork of UnrealImGui (ty btw), I noticed one issue with keyboard+mouse input.

I tracked it down to the code in UImGuiInputHandler::OnMouseButtonDown:

if (ModuleManager)
{
    FImGuiContextProxy* Proxy = ModuleManager->GetContextManager().GetContextProxy(0);
    if (Proxy)
    {
        //GEngine->AddOnScreenDebugMessage(15, 10, Proxy->WantsMouseCapture() ? FColor::Green : FColor::Red, TEXT("Handler Down"));
        return ToReply(Proxy->WantsMouseCapture());
    }
}

If I remove that block, the behavior goes away and the game never receives the CTRL input while ImGUI input is active.

This is about as far as I can take it. I imagine the code above was added to fix an issue from segross's branch but I am not sure what. If I can help more narrowing down a repro please let me know.

jonpas commented 7 months ago

I am currently reworking the Input to use imgui's new API. I suggest to take another look at this after that is done (no ETA though).