UMG widget loses focus when window clicked on

I have a UMG widget that I put in focus using the “Set Input Mode Game and UI” node. If I click on the window or the window loses and then regains focus then my widget no longer receives any keyboard input. Here’s a repro project I made: project

The steps to repro this are

  1. Create a Widget blueprint, set Is Focusable to true
  2. Override OnKeyDown to print a string and return Handled
  3. Create the widget in your level blueprint, add it to the viewport, set the input mode to Game and UI
  4. Run the game, press some buttons, see your print message
  5. Click the window, press some buttons, no message
  6. Restart, alt+tab away and back, press buttons, no message

Hello kgamble,

After reading over your description and running a few tests I feel that this was working as intended. After clicking off of the widget the input mode will change to “game only” with the current setup. Once the focus is no longer on the widget the on key down will not fire. If you put a button in the widget, click on it, and then press some buttons you will see that the OnKeyDown function will fire.

Make it a great day