# Remapping the default UI navigation keys

**URL:** <https://forums.unrealengine.com/t/remapping-the-default-ui-navigation-keys/452916>\
**Category:** UI\
**Tags:** unreal-engine, UI, Widget, Blueprint, question, UMG\
**Created:** [July 27, 2019, 10:20am UTC](https://forums.unrealengine.com/t/remapping-the-default-ui-navigation-keys/452916 "2019-07-27T10:20:24Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![nxaxrxo](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/nxaxrxo/32/1027462_2.png) [@nxaxrxo](https://forums.unrealengine.com/u/nxaxrxo)\
**Post date:** [July 27, 2019, 10:20am UTC](https://forums.unrealengine.com/t/remapping-the-default-ui-navigation-keys/452916/1 "2019-07-27T10:20:24Z")

</div>

Not quite sure if this is an easy task. In my Widgets, I am able to move around the buttons using the keys on my keyboard (Up, down, left, right arrows), now, to press on a button, you can do so by pressing enter or spacebar. However, the spacebar is connected to another action and I cannot have it activate the press of that button. This is however automatically there at default, **is there a particular way to remap which keys can do what in your UI navigation?**

This could also make WASD navigation between buttons possible or pressing Y on a gamepad to activate a button instead of A and so on.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_827c8710](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_827c8710](https://forums.unrealengine.com/u/anonymous_user_827c8710)\
**Post date:** [November 11, 2020, 7:29am UTC](https://forums.unrealengine.com/t/remapping-the-default-ui-navigation-keys/452916/2 "2020-11-11T07:29:34Z")

</div>

I have a similar problem. Is there a way to modify default widget navigation system?

---

<div class="post-metadata">

**Author:** ![nxaxrxo](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/nxaxrxo/32/1027462_2.png) [@nxaxrxo](https://forums.unrealengine.com/u/nxaxrxo)\
**Post date:** [November 11, 2020, 7:35am UTC](https://forums.unrealengine.com/t/remapping-the-default-ui-navigation-keys/452916/3 "2020-11-11T07:35:02Z")

</div>

I haven’t found a way to do it since, but for my particular problem, I just disabled the input on another function that would usually be activated. It would still be useful to know how to remap these though!

---

<div class="post-metadata">

**Author:** ![s54780478](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@s54780478](https://forums.unrealengine.com/u/s54780478)\
**Post date:** [February 10, 2023, 7:29am UTC](https://forums.unrealengine.com/t/remapping-the-default-ui-navigation-keys/452916/4 "2023-02-10T07:29:33Z")

</div>

Yap, I still has same problem in 2023

---

<div class="post-metadata">

**Author:** ![patate4020](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@patate4020](https://forums.unrealengine.com/u/patate4020)\
**Post date:** [February 26, 2024, 5:58pm UTC](https://forums.unrealengine.com/t/remapping-the-default-ui-navigation-keys/452916/5 "2024-02-26T17:58:38Z")

</div>

same problem in 2024

---

<div class="post-metadata">

**Author:** ![WonderPvP1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@WonderPvP1](https://forums.unrealengine.com/u/WonderPvP1)\
**Post date:** [July 20, 2024, 6:34pm UTC](https://forums.unrealengine.com/t/remapping-the-default-ui-navigation-keys/452916/6 "2024-07-20T18:34:09Z")

</div>

Maybe found a fix for your problem.

 ![blockSelectedKeys](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/5/3/c5320023faa14b30a97be6a5b9021b03527ee57a.png)  
Basically it will block the enter and space bar input in the entire widget, but on the true line you can call any function or custom event and run that with the key you wanted.

---

<div class="post-metadata">

**Author:** ![rocknswole](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@rocknswole](https://forums.unrealengine.com/u/rocknswole)\
**Post date:** [October 17, 2024, 1:02am UTC](https://forums.unrealengine.com/t/remapping-the-default-ui-navigation-keys/452916/8 "2024-10-17T01:02:31Z")

</div>

This works perfectly, 5 years to late though,

> [@Control UI using WASD instead of Arrow Keys?](https://forums.unrealengine.com/t/control-ui-using-wasd-instead-of-arrow-keys/456920):
>
> Hello, I’ve created a UI Menu that can be navigated with a gamepad or the keyboard arrow keys. This was done by setting the game focus to my UI widget. However, because my game uses WASD to move, I feel like it would be more intuitive and feel more natural if the player could navigate the menu using WASD as well/instead of the arrow keys. Is there a setting, or perhaps method to do this?

its pretty todo

Set up a GameModeBase C++ class below is my code just change your API, and then set the game mode up as that and it works great

and add in the dependices too to the build file

This was workign in UE5.4.2

----------------CPP---------------------------------

#pragma once

include “CoreMinimal.h”  
include “GameFramework/GameModeBase.h”  
include “Framework/Application/SlateApplication.h”  
include “Framework/Application/NavigationConfig.h”  
include “MyGameModeBase.generated.h”

// Custom Navigation Config class declaration  
class FCustomNavigationConfig : public FNavigationConfig  
{  
public:  
FCustomNavigationConfig()  
{  
// Map WASD to navigate like arrow keys  
KeyEventRules.Emplace(EKeys::W, EUINavigation::Up);  
KeyEventRules.Emplace(EKeys::S, EUINavigation::Down);  
KeyEventRules.Emplace(EKeys::A, EUINavigation::Left);  
KeyEventRules.Emplace(EKeys::D, EUINavigation::Right);  
}  
};

UCLASS()  
class FALKEGG2\_API AMyGameModeBase : public AGameModeBase  
{  
GENERATED\_BODY()

protected:  
virtual void BeginPlay() override;  
};

------ HEADER -----------

include “MyGameModeBase.h”  
include “Framework/Application/SlateApplication.h”  
include “Framework/Application/NavigationConfig.h”

void AMyGameModeBase::BeginPlay()  
{  
Super::BeginPlay();

// Create and apply the custom navigation configuration  
TSharedRef CustomNavConfig = MakeShared();  
FSlateApplication::Get().SetNavigationConfig(CustomNavConfig);

}

------Build.cs-------------

PublicDependencyModuleNames.AddRange(new string { “Core”, “CoreUObject”, “Engine”, “InputCore”, “EnhancedInput”,“Paper2D”,“PhysicsCore” , “Slate”, “SlateCore” });

PrivateDependencyModuleNames.AddRange(new string { “Slate”, “SlateCore” });
