segross / UnrealImGui

Unreal plug-in that integrates Dear ImGui framework into Unreal Engine 4.
MIT License
666 stars 211 forks source link

Can't Get Mouse Input When Showing HUD #66

Open paulSpliced opened 2 years ago

paulSpliced commented 2 years ago

I'm seeing a problem where having a HUD with widget elements shown is causing mouse inputs to be swallowed because of what looks like a lack of focus.

Below are two logs in which I am enabling input and then clicking on one of the menus that appears (so I would expect a receipt of focus and a mouse enter event).

Here is the log when I have a HUD shown with widget elements -

[2022.05.06-22.52.30:769][ 71]LogImGuiWidget: ImGui Widget -2 - Input Enabled changed to 'true'. [2022.05.06-22.52.30:769][ 71]LogImGuiWidget: VeryVerbose: ImGui Widget -2 - Visibility updated to 'Visible'. [2022.05.06-22.52.30:770][ 71]LogImGuiWidget: VeryVerbose: ImGui Widget -2 - Taking focus for player. [2022.05.06-22.52.30:774][ 72]LogImGuiWidget: VeryVerbose: ImGui Widget -2 - Focus Received. [2022.05.06-22.52.30:780][ 73]LogImGuiWidget: VeryVerbose: ImGui Widget -2 - Mouse Leave. [2022.05.06-22.52.31:892][306]LogImGuiWidget: VeryVerbose: ImGui Widget -2 - Focus Lost.

And here is the same flow with a HUD without widgets -

[2022.05.06-22.54.12:539][310]LogImGuiWidget: ImGui Widget -2 - Input Enabled changed to 'true'. [2022.05.06-22.54.12:540][310]LogImGuiWidget: VeryVerbose: ImGui Widget -2 - Visibility updated to 'Visible'. [2022.05.06-22.54.12:540][310]LogImGuiWidget: VeryVerbose: ImGui Widget -2 - Taking focus for player. [2022.05.06-22.54.12:544][311]LogImGuiWidget: VeryVerbose: ImGui Widget -2 - Focus Received. [2022.05.06-22.54.12:549][312]LogImGuiWidget: VeryVerbose: ImGui Widget -2 - Mouse Leave. [2022.05.06-22.54.13:406][489]LogImGuiWidget: VeryVerbose: ImGui Widget -2 - Mouse Enter. [2022.05.06-22.54.16:297][ 84]LogImGuiWidget: VeryVerbose: ImGui Widget -2 - Mouse Leave.

In the first log I never see a Mouse Enter event, instead only a Mouse Leave followed by a Focus Lost. Again the only difference (that I can tell matters) between these two things is that one has a HUD with widgets on it and the other does not.

Any insight into this would be very appreciated!