Hi,
I try to open a SBrowserWidget in the scene so that it covers only part of the scene. I would like the player to do normal actions, i.e. use controls, while the browser widget is open. However, when I open the browser, it seems to steal the input focus, and I havent found a method to make it “modeless”.
I open the browser like this:
void AStandardHUD::BeginPlay()
{
SlateBrowserWidget = SNew(SWebBrowser)
.ShowErrorMessage(false)
.InitialURL(TEXT("https://www.google.com"))
.OnUrlChanged(BIND_UOBJECT_DELEGATE(FOnTextChanged, HandleOnUrlChanged));
GEngine->GameViewport->AddViewportWidgetContent(
SNew(SWeakWidget).PossiblyNullContent(SlateBrowserWidget.ToSharedRef()) );
FVector2D scale_size;
scale_size.X = 0.25;
scale_size.Y = 0.25;
SlateBrowserWidget->SetContentScale(scale_size);
// Set widget's properties as visible (sets child widget's properties recursively)
SlateBrowserWidget->SetVisibility(EVisibility::Visible);
}
I have studied the widget class hierarchy, but there is no obvious way to yield the focus to actual gameplay.
How to solve?