# Using Only Keyboard Inputs on Widgets

**URL:** <https://forums.unrealengine.com/t/using-only-keyboard-inputs-on-widgets/1274234>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine, Widget\
**Created:** [August 27, 2023, 1:14pm UTC](https://forums.unrealengine.com/t/using-only-keyboard-inputs-on-widgets/1274234 "2023-08-27T13:14:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![blagic23](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@blagic23](https://forums.unrealengine.com/u/blagic23)\
**Post date:** [August 27, 2023, 1:14pm UTC](https://forums.unrealengine.com/t/using-only-keyboard-inputs-on-widgets/1274234/1 "2023-08-27T13:14:26Z")

</div>

I created main menu that simply only have “Start”, “Settings” and “Quit” buttons. I can do whatever I want via mouse, but I do not want to use mouse for main menu. I want to cycle between options with Up and Down keys.

Frankly, I have no clue on how to do it. I searched online but found nothing that will help me with this. I considered creating a box player and moving it between the options, but it would be too much work and extremely buggy. What can I do in this instance?

---

<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:** [August 27, 2023, 1:24pm UTC](https://forums.unrealengine.com/t/using-only-keyboard-inputs-on-widgets/1274234/2 "2023-08-27T13:24:41Z")

</div>

Any widget can lead to any other widget:

> [@Is there a way to edit the tab order in UMG?](https://forums.unrealengine.com/t/is-there-a-way-to-edit-the-tab-order-in-umg/306219/7):
>
> One can set very explicit navigation rules for any widget that can keyboard focus: [image] Next / Previous corresponds to Tab / Shift Tab afair. afair Yup: While this button has keyboard focus Tab goes to button 5, Shift+Tab goes to button 3.

* * *

I mean, if you used buttons (as most people do), the keyboard navigation already works by default. There’s no need to do anything special.

- widget

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/f/d/7fdf09087f81107e9da19cc9c88a48653534bd9d.png)

- add and set focus to the button you need to start with:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/a/e/2ae94fcef2a648d5fea2aa2538a34c414d982b7e.png)

* * *

You’d only set up navigation for more complex scenarios, like:

> cycle between options

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/8/a/08ac29c14826253d7ea3d7000a1066c04468d3d6.png)

The last button now leads to first, so you can keep mashing ⬇ to cycle.

---

<div class="post-metadata">

**Author:** ![blagic23](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@blagic23](https://forums.unrealengine.com/u/blagic23)\
**Post date:** [August 27, 2023, 4:13pm UTC](https://forums.unrealengine.com/t/using-only-keyboard-inputs-on-widgets/1274234/3 "2023-08-27T16:13:08Z")

</div>

I did exactly like you said, still, nothing happens. I set the keyboard focus on the first button, and also set the button visibility to “non-hit testable” for disabling mouse movement. But nope, nothing happens. I can not focus on any of the buttons.

---

<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:** [August 27, 2023, 6:10pm UTC](https://forums.unrealengine.com/t/using-only-keyboard-inputs-on-widgets/1274234/4 "2023-08-27T18:10:51Z")

</div>

> [@blagic23](#):
>
> and also set the button visibility to “non-hit testable” for disabling mouse movemen

Well, that would disable any and all interaction. A button needs to be Visible to be interactive. Any widget can decide whether and which cursor needs showing:

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/9/5/a950a7ba1a608d34ab35bf70453f20ea5149c97b.png)

---

<div class="post-metadata">

**Author:** ![blagic23](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@blagic23](https://forums.unrealengine.com/u/blagic23)\
**Post date:** [August 27, 2023, 7:02pm UTC](https://forums.unrealengine.com/t/using-only-keyboard-inputs-on-widgets/1274234/5 "2023-08-27T19:02:26Z")

</div>

You sir, are a gem. It works, though when I click on the simulation to get rid of the cursor, focus is lost. I tried assigning widget focus to Play button whenever mouse clicks anywhere but that didn’t seem to work.

 ![Adsız](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/f/f/5ffe049f3f9597edd49e38ff52c63223ff5810cc.png)

And I also end up with this ugly frame around the button. I remember it could be disabled from project settings but could not find it.

Lastly, focusing on a widget does not actually show the hovering over image for it. I am now going to try manually writing the up and down functions and set the hovering over image after it.
