# Keyboard loses focus when opening HUD element

**URL:** <https://forums.unrealengine.com/t/keyboard-loses-focus-when-opening-hud-element/508852>\
**Category:** Blueprint\
**Tags:** unreal-engine, UI, UE4-26, question\
**Created:** [March 22, 2022, 10:45am UTC](https://forums.unrealengine.com/t/keyboard-loses-focus-when-opening-hud-element/508852 "2022-03-22T10:45:39Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [March 22, 2022, 11:21am UTC](https://forums.unrealengine.com/t/keyboard-loses-focus-when-opening-hud-element/508852/2 "2022-03-22T11:21:14Z")

</div>

How is the `Tab` key pressing implemented in the the widget’s `onKeyDown`? Is the widget keyboard focusable?

Here’s the whole shebang:

> [@Close menu with same button as opening](https://forums.unrealengine.com/t/close-menu-with-same-button-as-opening/485710/10):
>
> Not stupid at all, actually. It’s just an input processing thing. Set Input Mode UI Only prevents the Player Controller from processing input - pressing M while this mode is active does nothing, the PC ignores it, as instructed. The input is processed in the widget instead since we’ve given it to the UI exclusively - Set Input Mode UI Only You can have it processed by both (widgets go first, though) with Set Input Mode Game and UI node but if you’re making a first person shooter kind of game (…

* * *

I see you’re using `Input Mode Game and UI` but it’s pretty much the same case. You grant Character Sheet focus - the PC cannot process input unless the widget loses it. Clicking on the screen does it, the PC gets focus back and the ability to process input again.

* * *

Consider implementing the Tab → Close in the widget. Or do not give the widget focus in the first place. Kind of depends on how you need the whole thing to work.

---

_[View the full topic](https://forums.unrealengine.com/t/keyboard-loses-focus-when-opening-hud-element/508852)._
