# How to transfer/keep PlayerMappableOptions when remapping

**URL:** <https://forums.unrealengine.com/t/how-to-transfer-keep-playermappableoptions-when-remapping/736479>\
**Category:** Blueprint\
**Tags:** unreal-engine, Blueprint, question\
**Created:** [December 26, 2022, 6:40pm UTC](https://forums.unrealengine.com/t/how-to-transfer-keep-playermappableoptions-when-remapping/736479 "2022-12-26T18:40:10Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![rokenrock](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rokenrock/32/1040844_2.png) [@rokenrock](https://forums.unrealengine.com/u/rokenrock)\
**Post date:** [February 14, 2023, 7:51pm UTC](https://forums.unrealengine.com/t/how-to-transfer-keep-playermappableoptions-when-remapping/736479/8 "2023-02-14T19:51:28Z")

</div>

**An edit after the fact- it seems that this process has been massively simplified in 5.3. I haven’t had the time to upgrade to 5.3 and get a comprehensive look, but it may now be as simple as it should’ve been.**

So the solution to this involves quite a few steps, and doing anything wrong breaks everything, but I’ve finally figured it out.

**One note → Absolutely Never use RemovePlayerMappedKey**   
It will break everything.

* * *
  

First, you have to get an array of all your contexts. As far as I know, there’s no way to use this method and save to the contexts. Though, this may be considered a positive since you don’t have to save defaults- these contexts will always have their default values, meaning don’t check them for current values (cause they won’t be).

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/4/6/a46753c351b87098461bab3b2cc6884052b327d2.png)

* * *
  

Second, you have to apply all your mappings from those contexts, making sure to enable apply immediately. This should be done on begin play.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/9/e/c9e77825cbb0bfa6b66a6fc6dce9d55f30ec3ab2.png)  
The GetAllPlayerMappableActionKeyMappings macro in this image is just made cause I use it so often, but what it does is gets all the mappings from every context, checking if they’re player mappable. This can be done with a built in function of the same name, but that only checks active contexts. It can be substituted for this:  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/c/5/1c55865af6bcdb636918141780ad82fc77196ee4.png)

* * *
  

I have my GetKeybind in a function library, but you can put it anywhere. This is how I’ve implemented it. This will work so long as you’ve done the previous steps prior to calling this.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/9/e/89e08cc51ea6fd4bd35642c73dd4442a792d793d.png)

* * *
  
This is the function I'm using to change keybinds. Pretty simple- just use the name you've assigned to the keybind and make sure to call save.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/4/7/6476c221617d7b4d5887dedf9498f0d700cc2e83.png)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/f/0/2f00c8a07400e9e15c33b00a84893d59a63dffda.png)

* * *
  
  
**This part forward is for saving and loading**  
  

After pushing these changes in the first step, check whether there is a save for keybinds already. If yes, load.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/4/6/e469ece744d656eaa20d668f74e7cb5c83ef1352.png)

The loading is straightforward, just make sure to use the player controller input subsystem:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/3/9/6393269b2d7924ea6e4f4e71bb66d212c5fcfc10.png)

And the loading is even simpler. I’m using the same macro as I used before, and I’m just adding the data to a map in the savegame. Saving is done whenever a keybind is changed.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/2/c/42c4db65f1dd0b60850ae8d149cd5aea798a90fc.png)

---

_[View the full topic](https://forums.unrealengine.com/t/how-to-transfer-keep-playermappableoptions-when-remapping/736479)._
