# Gamepad/Keyboard navigation in UMG menus?

**URL:** <https://forums.unrealengine.com/t/gamepad-keyboard-navigation-in-umg-menus/301671>\
**Category:** UI\
**Tags:** gamepad, controller, UE4-6, unreal-engine, UI, question, UMG\
**Created:** [December 15, 2014, 5:15pm UTC](https://forums.unrealengine.com/t/gamepad-keyboard-navigation-in-umg-menus/301671 "2014-12-15T17:15:23Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![iscaru1988](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@iscaru1988](https://forums.unrealengine.com/u/iscaru1988)\
**Post date:** [December 15, 2014, 5:15pm UTC](https://forums.unrealengine.com/t/gamepad-keyboard-navigation-in-umg-menus/301671/1 "2014-12-15T17:15:23Z")

</div>

Hi!

I’m trying to use UMG for my game menus but my game is suposed to be used with gamepad and I don’t know how to bind the keyboard/Gamepad buttons to move along the menus.

In the 4.6 release it is suposed that we can do it:

UI: GAME CONTROLLER SUPPORT

You can now navigate between UI elements using a joystick!

By default you can use the arrow keys, directional pad or left joystick to navigate. You can still use Tab or Shift+Tab as well. This works with both Slate and Unreal Motion Graphics.  
We’ve unified the concept of “Keyboard Focus” and “Controller Focus” into “User Focus”. Changing user focus will affect all controllers and keyboards for that user.

Am I missing something?

Can someone make a little tutorial on how to achieve this?

I’ve tried to search documentation about this but i didn’t find anything useful for me.

---

<div class="post-metadata">

**Author:** ![TheFoyer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TheFoyer](https://forums.unrealengine.com/u/TheFoyer)\
**Post date:** [December 15, 2014, 5:20pm UTC](https://forums.unrealengine.com/t/gamepad-keyboard-navigation-in-umg-menus/301671/2 "2014-12-15T17:20:34Z")

</div>

I too am interested in this information. For now I handle all the states manually, and when a controller/keyboard direction is hit the player controller fires an event on the widget that will check which option you currently have selected, and which one should be selected next. It’s not ideal for sure. Then I have to handle the hover/pressed states of the button manually.

---

<div class="post-metadata">

**Author:** ![CHADALAK1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@CHADALAK1](https://forums.unrealengine.com/u/CHADALAK1)\
**Post date:** [January 19, 2015, 8:06pm UTC](https://forums.unrealengine.com/t/gamepad-keyboard-navigation-in-umg-menus/301671/3 "2015-01-19T20:06:52Z")

</div>

I also am interested in this information… Really would like to know what is needed to do this

---

<div class="post-metadata">

**Author:** ![cgrebeld](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@cgrebeld](https://forums.unrealengine.com/u/cgrebeld)\
**Post date:** [January 30, 2015, 6:33pm UTC](https://forums.unrealengine.com/t/gamepad-keyboard-navigation-in-umg-menus/301671/4 "2015-01-30T18:33:30Z")

</div>

Me too… in what case does this actually work?

---

<div class="post-metadata">

**Author:** ![CaptainMcMarcus](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@CaptainMcMarcus](https://forums.unrealengine.com/u/CaptainMcMarcus)\
**Post date:** [January 31, 2015, 1:40pm UTC](https://forums.unrealengine.com/t/gamepad-keyboard-navigation-in-umg-menus/301671/5 "2015-01-31T13:40:39Z")

</div>

The closest I’ve been able to get this is by putting a bunch of buttons into a vertical container and then when you click anywhere inside the container you can then cycle through the buttons on your controller. It’s a bit impractical but it’s the closest I’ve got to get it working. I’m also interested in working out how to get it working without having to do clicks.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b99db473](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b99db473](https://forums.unrealengine.com/u/anonymous_user_b99db473)\
**Post date:** [January 31, 2015, 10:36pm UTC](https://forums.unrealengine.com/t/gamepad-keyboard-navigation-in-umg-menus/301671/6 "2015-01-31T22:36:42Z")

</div>

I also am trying this, I think its not really implemented properly yet so far,

What I do is in c++ grab the widget I want `TakeWidget()` and then use `SlateOperations.SetUserFocus()` to set the focus to that widget, this lets me use my gamepad, although I have no idea how to change the visuals of that dashed edge you get.  
My guess is we have to either learn Slate or wait for better support for UWidgets

---

<div class="post-metadata">

**Author:** ![cgrebeld](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@cgrebeld](https://forums.unrealengine.com/u/cgrebeld)\
**Post date:** [February 10, 2015, 2:19pm UTC](https://forums.unrealengine.com/t/gamepad-keyboard-navigation-in-umg-menus/301671/7 "2015-02-10T14:19:10Z")

</div>

I ended up doing it all manually in c++. I keep a navigation ring of button pointers and manually set the ‘hover’ state of all my buttons (at the slate level) depending on the gamepad input events.

It works perfectly with gamepad and mouse/keyboard, but of course it would be awesome if the built-in navigation system actually worked!

---

<div class="post-metadata">

**Author:** ![kshepitzki\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@kshepitzki\_1](https://forums.unrealengine.com/u/kshepitzki_1)\
**Post date:** [February 18, 2015, 6:48am UTC](https://forums.unrealengine.com/t/gamepad-keyboard-navigation-in-umg-menus/301671/8 "2015-02-18T06:48:43Z")

</div>

Hi cgrebeld, I am trying to do the exact same thing, any chance of sharing your solution?  
Thanks

---

<div class="post-metadata">

**Author:** ![echoform](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@echoform](https://forums.unrealengine.com/u/echoform)\
**Post date:** [February 19, 2015, 12:38am UTC](https://forums.unrealengine.com/t/gamepad-keyboard-navigation-in-umg-menus/301671/9 "2015-02-19T00:38:57Z")

</div>

Hi Cgrebeld, so did you bind some function to “W”(some key) with function and in the function you invoke like “OnClicked” event of UMG Widget’s button? How would I get pointer to a button of the UMG widget in code?

Could you provide simple work flow of code?

---

<div class="post-metadata">

**Author:** ![ItsScotch](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ItsScotch](https://forums.unrealengine.com/u/ItsScotch)\
**Post date:** [May 1, 2015, 2:02am UTC](https://forums.unrealengine.com/t/gamepad-keyboard-navigation-in-umg-menus/301671/10 "2015-05-01T02:02:17Z")

</div>

I am looking for the same thing… does anyone have solution?

---

<div class="post-metadata">

**Author:** ![CodeSpartan](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/codespartan/32/1194561_2.png) [@CodeSpartan](https://forums.unrealengine.com/u/CodeSpartan)\
**Post date:** [May 16, 2015, 2:55pm UTC](https://forums.unrealengine.com/t/gamepad-keyboard-navigation-in-umg-menus/301671/11 "2015-05-16T14:55:43Z")

</div>

Update: this works with a gamepad as well (tested with an Xbox controller)

I can navigate with keyboard up/down keys using this setup:

Level/character blueprint:

 ![42959-keyboard1.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/2/3/e2352624d19a00ab1b90199e1e14aab462c2f1e0.png)

in UMG widget (optional, if you want to customize appearance):

 ![42960-keyboard2.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/3/0/43082ba79543bb3ca639e054e8638f70ea36a655.png)

The result (it would be nice if we could change the default “dotted line” focused look):

 ![42958-keyboard+nav.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/8/9/98960558860d6610cc37a2b94b7ac6ac99de86ce.png)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_2f116e5b](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_2f116e5b](https://forums.unrealengine.com/u/anonymous_user_2f116e5b)\
**Post date:** [May 16, 2015, 4:19pm UTC](https://forums.unrealengine.com/t/gamepad-keyboard-navigation-in-umg-menus/301671/12 "2015-05-16T16:19:25Z")

</div>

@CodeSpartan  
Not working for me, I have placed my buttons in ‘Horizontal Grid’ and have added different images for Normal, Hovered and Clicked state under Style section. Even unchecked ‘Is Focusable’ under interaction section.  
Further I tried checking ‘Has Keyboard Focus’ which always returns ‘False’. I am not able to have keyboard focused on the button, any assistance please.

---

<div class="post-metadata">

**Author:** ![CodeSpartan](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/codespartan/32/1194561_2.png) [@CodeSpartan](https://forums.unrealengine.com/u/CodeSpartan)\
**Post date:** [May 17, 2015, 7:55am UTC](https://forums.unrealengine.com/t/gamepad-keyboard-navigation-in-umg-menus/301671/13 "2015-05-17T07:55:05Z")

</div>

I’ve uploaded a sample project: [Cahoots — Ann Arbor tech coworking](https://copy.com/OWm8XLDSo28TRZ7e)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_2f116e5b](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_2f116e5b](https://forums.unrealengine.com/u/anonymous_user_2f116e5b)\
**Post date:** [May 17, 2015, 8:06am UTC](https://forums.unrealengine.com/t/gamepad-keyboard-navigation-in-umg-menus/301671/14 "2015-05-17T08:06:01Z")

</div>

Hey thanks for the sample project, downloading started 🙂  
Yes got it working. 🙂

---

<div class="post-metadata">

**Author:** ![Raed\_Abbas](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/raed_abbas/32/482168_2.png) [@Raed\_Abbas](https://forums.unrealengine.com/u/Raed_Abbas)\
**Post date:** [June 6, 2015, 3:53pm UTC](https://forums.unrealengine.com/t/gamepad-keyboard-navigation-in-umg-menus/301671/15 "2015-06-06T15:53:30Z")

</div>

So basically there’s no such thing as “You can now navigate between UI elements using a joystick!” am I right?

---

<div class="post-metadata">

**Author:** ![CodeSpartan](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/codespartan/32/1194561_2.png) [@CodeSpartan](https://forums.unrealengine.com/u/CodeSpartan)\
**Post date:** [June 11, 2015, 5:13pm UTC](https://forums.unrealengine.com/t/gamepad-keyboard-navigation-in-umg-menus/301671/16 "2015-06-11T17:13:50Z")

</div>

I’ve just tried my sample project with an Xbox controller - you can both navigate and press buttons. You can download it from the link above and check for yourself.

---

<div class="post-metadata">

**Author:** ![Imsopov](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Imsopov](https://forums.unrealengine.com/u/Imsopov)\
**Post date:** [July 16, 2015, 12:02am UTC](https://forums.unrealengine.com/t/gamepad-keyboard-navigation-in-umg-menus/301671/17 "2015-07-16T00:02:54Z")

</div>

Thank you, this helped me also.

---

<div class="post-metadata">

**Author:** ![SkeetonYu](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SkeetonYu](https://forums.unrealengine.com/u/SkeetonYu)\
**Post date:** [August 23, 2015, 1:28pm UTC](https://forums.unrealengine.com/t/gamepad-keyboard-navigation-in-umg-menus/301671/18 "2015-08-23T13:28:50Z")

</div>

What did you do to get it working? I’m at the same problem as you had before.

---

<div class="post-metadata">

**Author:** ![SkeetonYu](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SkeetonYu](https://forums.unrealengine.com/u/SkeetonYu)\
**Post date:** [August 23, 2015, 1:31pm UTC](https://forums.unrealengine.com/t/gamepad-keyboard-navigation-in-umg-menus/301671/19 "2015-08-23T13:31:28Z")

</div>

Nvm, one of my wire was mixed up.

---

<div class="post-metadata">

**Author:** ![SkeetonYu](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SkeetonYu](https://forums.unrealengine.com/u/SkeetonYu)\
**Post date:** [August 23, 2015, 4:09pm UTC](https://forums.unrealengine.com/t/gamepad-keyboard-navigation-in-umg-menus/301671/20 "2015-08-23T16:09:30Z")

</div>

Is there a way to get rid of the dotted square?

[Next page](https://forums.unrealengine.com/t/gamepad-keyboard-navigation-in-umg-menus/301671.md?page=2)
