Open ddbrown30 opened 1 year ago
Same issue with unreal 5.2 i cant toggle with the keybinding. Any solution?
Same issue with unreal 5.2 i cant toggle with the keybinding. Any solution?
My solution is no use the Shortcut keys, and switch imgui input enable when whether the GameViewport is in focus.
SImGuiWidget.cpp: Add the fourth line of code to the source code below
1 void SImGuiWidget::Tick(const FGeometry& AllottedGeometry, const double InCurrentTime, const float InDeltaTime)
2 {
3 Super::Tick(AllottedGeometry, InCurrentTime, InDeltaTime);
4 ModuleManager->GetProperties().SetInputEnabled(!GameViewport.Get()->GetGameViewport()->HasMouseCapture());
5 UpdateInputState();
6 UpdateTransparentMouseInput(AllottedGeometry);
7 HandleWindowFocusLost();
8 UpdateCanvasSize();
9 }
check Share Mouse Input in the plugin settings.(project setting>ImGui>Input).
After running the window, pressing Shift+F1 or other methods will cause the window to lose focus, and the imgui input will be enabled; When clicking on the viewport, game operations will resume
If SImGuiWidget does not have focus, it will not receive calls to SImGuiWidget::OnKeyDown. This means that ToggleInput cannot be called which is what gives us focus in the first place. I'm not sure if something has changed in UE 5.1 as this appears to work in this tutorial video from 9 months ago on 5.0.1. https://youtu.be/qyO38jX5RU8