-
Notifications
You must be signed in to change notification settings - Fork 223
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improvements to sharing mouse input #63
Comments
I wonder if input preprocessors might be helpful? |
Made some progress by adding this to With mouse input sharing disabled, the payer controller still receives clicks when clicking outside ImGui windows, and ImGui receives events when clicking inside ImGui windows. It's probably a naive solution and I'm going to hit some big problem soon, but maybe it will help someone develop a better solution? FReply UImGuiInputHandler::OnMouseButtonDown(const FPointerEvent& MouseEvent)
{
if (MouseEvent.IsTouchEvent())
{
return ToReply(false);
}
InputState->SetMouseDown(MouseEvent, true);
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());
}
}
return ToReply(true);
} |
I know it is not likely a proper way to do this, but it seems to work by just comment out those two lines of code in SImGuiWidget.cpp
I am wondering if we just don't disable the input when viewport has taken the focus, what could go wrong? |
Creating a new ticket as the old one was closed
#49
I read the description of input sharing and the issues with mouse being that there is an ImGui Slate widget covering the whole screen and intercepting mouse events. I'm not a complete expert on how your plugin works so maybe this is a naive idea but...
I see that
ImGuiInputHandler
returnsFReply::Handled
for MouseDown and MouseUp events and that seems to be what make sure that mouse clicks on the UI don't accidentally go through to the game.Is there no way to only return
FReply::Handled
if the cursor is over a UI element? That way the Slate widget can behave kind of likeHitTestInvisible
?Edit: Okay yeah it was mega naive, checking for
WantCaptureMouse
andIsWindowHovered
doesn't work, even though the imgui demo window seems to show the flags correctly.The text was updated successfully, but these errors were encountered: