Remapping keys with Enhanced Input Plugin (Blueprint)

Hi everyone!
I’d like to know how can I re-map (some) input keys using Blueprint Graph.

e.g. I have an Input Map Context “MC_NormalMovement” and an Input Action “Move”… “Move” Input Action has “WASD” mapping… I’d like to re-map “WASD” with “WJSL”… Then I’d like to re-map only some keys, not all… Can someone help me showing me the correct Blueprint Graph for this? (I could trigger this when onCliked Button Event triggers)…

Thanks to everyone :blush: :pray:

1 Like

Hey @Artorias93x! You can totally do that! Here is a tutorial on rebinding Keys and Axis Mappings with blueprints as a baseline to modify.

1 Like

Hi, thanks!

I have a question: I saw that video, but I don’t understand how that Blueprint can “switch” my A-key with J-key and my D-key with L-key… The Blueprint uses “Remove Axis Mapping” and it removes every keys mapped in the InputAction… I guess it works because it has “MoveForward” InputAction, but I have a “Move” InputAction with modifiers to track axis on X, Y, reversed-X and reversed-Y (as in the picture)… Is it possible to adapt the Blueprint to my mapping? Or Have I to have a 1-to-1 mapping?

Hey there,

Lyra provides a completely working example of player remappable keys with Enhanced Input. Check out the “AddOrUpdateCustomKeyboardBindings” function in LyraSettingsLocal.cpp as well as ULyraInputComponent::AddInputMappings in LyraInputComponent.cpp.

As of UE 5.0, Enhanced Input has out of the box support for player mappable keys with the “Player Mappable Options” in an input mapping context.

This exposes some metadata options for each key mapping as well as an FName that you can give that key mapping to save it to your settings.

I hope that helps,
Ben

3 Likes

Hey there, just a quick question related to something you mentioned about saving key binds. Does the enhanced input not included a build in save system like the old inputs system? I’m having the issue that after changing the key binds they revert back after restarting the game or engine.

Do we now have to put together our own key bind save system with enhanced input or is there something similar to the SaveKeyMappings function from the old inputs system we can use?

Thanks :slight_smile:

Hello, my project is single player so I guss I don’t need to mess up with local player keymappings?

Is it possible to properly update mapping context object on runtime with ability to set triggers, modifiers, player mappable options?

Currently we have the “Map Key” blueprint node with target “Input Mapping Context” but I can’t supply any data like triggers, modifiers, player mappable options, etc.

I also really would like to know if theres some tutorial for saving. Im having same issue and ive been trying to look Lyra sample, but its… a little overwhelming… but does have this functionality.

I ended up having to make a custom save system for controls that load when the game starts using the save objects that come with the engine. I did report the issue of the controls not saving with Epic and it has been added to the Bug tracker here:

It says it due to be fixed in 5.2 but the more votes it get means its more likely Epic will get to fixing it asap.

i decided to make a tut on this since i can’t find a straight forward method for remapping, hope it helps

1 Like