How to Automatically Return Focus to Viewport After Click

Hi friends,

I am trying to understand the focus system in Slate/UMG. My problem is as follows:

  1. I set the player’s custom cursor to something other than Default (e.g. TextBeam).
  2. I click on a button. The viewport loses focus.
  3. I mouse over viewport, but Default cursor shows because viewport lacks focus.
  4. I click, and viewport regains focus. Custom cursor appears.

I want to avoid clicking on the viewport to regain focus. Is there a way to make Slate automatically give focus back to the viewport once a mouse click ends or the mouse leaves a button/widget?

Hi man, you can set the focus of the mouse on ui and game or both using these nodes
set input mode ui
set input mode game