# How to Control UI By Keyboard Buttons And Gamepad

**URL:** <https://forums.unrealengine.com/t/how-to-control-ui-by-keyboard-buttons-and-gamepad/2092111>\
**Category:** UI\
**Tags:** unreal-engine, question\
**Created:** [October 28, 2024, 9:39am UTC](https://forums.unrealengine.com/t/how-to-control-ui-by-keyboard-buttons-and-gamepad/2092111 "2024-10-28T09:39:02Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![30quickdead](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@30quickdead](https://forums.unrealengine.com/u/30quickdead)\
**Post date:** [October 28, 2024, 9:39am UTC](https://forums.unrealengine.com/t/how-to-control-ui-by-keyboard-buttons-and-gamepad/2092111/1 "2024-10-28T09:39:03Z")

</div>

I have 4 different widgets for now, which have total of 16 buttons 3 checkboxes and 2 sliders.  
For now i just change values of these components with my mouse only, but i also want to change them with my keyboards arrow keys and also gamepads dpad or one of the thumbsticks.  
I found 2 approaches to this subject in the forums, one of them is a free plugin which seems okay but only works with button components and even if it works with other components i will need to make widgets from scratch again and i really dont want to do it.  
The other one is creating a player controller and a gamemode for only this subject which works in levels like main menu that you dont need a input for player but that wont work in playable levels which you will need your own gamemode.  
So can i acces to enhanced input from widgets? And use the same input keys that i use on my normal game for widgets, for example for in game menu i can pause the game and use dpad for going between buttons then close the widget and keep playing the normal game.

---

<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:** [October 28, 2024, 9:56am UTC](https://forums.unrealengine.com/t/how-to-control-ui-by-keyboard-buttons-and-gamepad/2092111/2 "2024-10-28T09:56:34Z")

</div>

Not sure I follow, this is already supported out of the box on widget level, without EI. Any widget has navigation rules you are free to override:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/0/d/10d5af5a726aa7d5c3457e7af754d07d4bdc38b4.png)

And any user widget can override `onKeyDown` / `onAnalogueValueChanged`; while buttons will accept input without overrides - like the spacebar, for example. I believe the gamepad’s x button is also there by default, but don’t quote me on that.

* * *

> [@30quickdead](#):
>
> So can i acces to enhanced input from widgets?

To answer this directly - yes, ofc! It’s a matter of granting widgets `Keyboard Focus`:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/c/0/ac070281d7cdf20505d1a0c8c4e27574223d46ee.png)

They can then process input natively or via the Enhanced Input.

---

<div class="post-metadata">

**Author:** ![30quickdead](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@30quickdead](https://forums.unrealengine.com/u/30quickdead)\
**Post date:** [October 28, 2024, 10:15am UTC](https://forums.unrealengine.com/t/how-to-control-ui-by-keyboard-buttons-and-gamepad/2092111/3 "2024-10-28T10:15:01Z")

</div>

> [@Everynone](#):
>
> Not sure I follow, this is already supported out of the box on widget level, without EI. Any widget has navigation rules you are free to override:
> 
> ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/0/d/10d5af5a726aa7d5c3457e7af754d07d4bdc38b4.png)
> 
> And any user widget can override `onKeyDown` / `onAnalogueValueChanged`

Oh, didnt know that, thats my bad, bad googling it seems.

---

<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:** [October 28, 2024, 10:19am UTC](https://forums.unrealengine.com/t/how-to-control-ui-by-keyboard-buttons-and-gamepad/2092111/4 "2024-10-28T10:19:57Z")

</div>

> [@30quickdead](#):
>
> bad googling it seems.

I can’t recall for sure, but it’s somewhat undocumented or documented poorly. Examples are scarce, but there might be something solid out there in the tutorial section or even YT 🤷

> [@Consistent UMG navigation with mouse, keyboard, or gamepad?](https://forums.unrealengine.com/t/consistent-umg-navigation-with-mouse-keyboard-or-gamepad/516735/29):
>
> Not sure if that would work in your case, but you can always fall back on dictating an explicit behaviour: Above, the icon is changing during onFocusLost / Received in the customBorder. This also gives you direct control over where the focus goes: Never fully understood how Escape and Wrap rules are supposed to work outside of containers. expressionless

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [November 27, 2024, 10:20am UTC](https://forums.unrealengine.com/t/how-to-control-ui-by-keyboard-buttons-and-gamepad/2092111/5 "2024-11-27T10:20:41Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
