# \[Blueprint\] How to swap two keys bindings in menu settings

**URL:** <https://forums.unrealengine.com/t/blueprint-how-to-swap-two-keys-bindings-in-menu-settings/1870055>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine, question, Blueprint\
**Created:** [May 24, 2024, 12:40am UTC](https://forums.unrealengine.com/t/blueprint-how-to-swap-two-keys-bindings-in-menu-settings/1870055 "2024-05-24T00:40:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ennrael](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ennrael/32/902834_2.png) [@Ennrael](https://forums.unrealengine.com/u/Ennrael)\
**Post date:** [May 24, 2024, 12:40am UTC](https://forums.unrealengine.com/t/blueprint-how-to-swap-two-keys-bindings-in-menu-settings/1870055/1 "2024-05-24T00:40:42Z")

</div>

Hi, I’m trying to finish my menu settings in a game that uses keyboard as a controller. I was able, with the Enhanced Input System, to allow the players to change their bindings but I would like that, whenever the player uses the same key (for example, they try to set E for an action but the Interaction action uses it already), the code swaps the two keys so that there isn’t any conflict and less hassle for the player.

I think I figured out the logic but I’m a little loss at the swapping part. Basically, it should occurs at the part of my code when the player is trying to set a new key: Get Player Controller → Get Enhanced Input Local Player Subsystem → Get Current Key Profile → Get Player Mappings Rows → Values → For Each Loop

Then once projected onto an array, compare the new key to every key inside the system, set a condition “If they are the same key” → Branch → If true, swap the two keys

Can someone help me figure it out? Thank you very much in advance for your attention 🙂

---

<div class="post-metadata">

**Author:** ![ImYourBeast](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/imyourbeast/32/1220194_2.png) [@ImYourBeast](https://forums.unrealengine.com/u/ImYourBeast)\
**Post date:** [November 22, 2026, 11:42am UTC](https://forums.unrealengine.com/t/blueprint-how-to-swap-two-keys-bindings-in-menu-settings/1870055/2 "2026-11-22T11:42:38Z")

</div>

When the player picks a key that is already used, look up which action currently owns that key before you assign anything. Move that owning action to the old key of the action being rebound, then assign the new key to the action the player was editing, and save both. Doing the swap as one pair keeps the menu free of duplicates without extra clicks. You can also try Advanced Input Rebinding System, it reports conflicts through OnKeyConflictDetected and swaps keys with RebindKey: [https://www.fab.com/listings/e8a77976-b4d4-4e8f-a4b4-c6a71a98554d](https://www.fab.com/listings/e8a77976-b4d4-4e8f-a4b4-c6a71a98554d)
