Blocking Keyboard Input Spill in Editor?


Some Context,
Simply said, I have a custom DockTab (containing a Slate WebBrowser) that I registered in the UE-Editor “Window” menu at the top.
Whenever I press that menu-entry I spawn said DockTab in a new window.

The issue I’m having happens once I’ve docked the Tab into the main Window.
When I type within this DockedTab’s Browser (ie. google search bar) the Key inputs are still registered by the main window.
For example: if I search ‘Fight Club’, it would register the letters F & H in the viewport and focus/hide a selected actor within it.

I want to figure out a way to prevent anything that I use my keyboard for within the DockTab/Browser to be used anywhere else in the Window when the Tab is Docked.
Is this possible?

Any help would be greatly appreciated! :slightly_smiling_face:

Turns out, in Slate Widgets, the way to do this is by doing Overrides.
So if you want you custom Widget/Tab to not allow any of the inputs that happen whilst its focused to be used, you’ll need to override the function that handles the input.

In this case, I inherited from the SCompoundWidget class, which should therefore apply to most usecases, I overrode the:
virtual FReply OnKeyDown(const FGeometry& MyGeometry, const FKeyEvent& InKeyEvent override);
function. And in the CPP all I did inside of that functions was:

FReply MyClass::OnKeyDown(const FGeometry& MyGeometry, const FKeyEvent& InKeyEvent)
     return FReply::Handled();

Hope this helps someone in the future :upside_down_face: