Skip to content

Issue with keys and mouse capture #9

@daveratti

Description

@daveratti

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

  • Unreal 5.3
  • Enhanced Input (probably doesn't matter)
  • While using PIE
  • ImGUI input is active (ImGUI.ToggleInput)
  • I hold down CTRL and then press LMB while the cursor is over the PIE/game window.
  • When I click LMB, the CTRL key 'down' gets passed through to the game. The action our game triggers with CTRL is pressed happens even though the game should not be receiving any input while ImGUI input is toggled.

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions