Enhanced Input - Remapping delete Triggers, Modifiers, action, etc...

Hello,

I’m currently stuck with remapping…

The WB works perfectly it display the name and the InputKeySelector and it update the key properly, but I can’t find a way to have the triggers, modifiers, action, etc… to be transferred to the new mapping…

Anyone can tell what I’m I doing wrong?


1 Like

Hi, I’m currently having the same problem in ue5.3. did you happen to find a solution ?

1 Like

This documentation regarding Common UI and EnhancedInput may help. See section 3 which references specifying a metadata asset that implements the ICommonMappingContextMetadataInterface.

Have you set the metadata property for your input action(s)? Perhaps that’s what you’re missing.

Thanks for the reply, i did as followed in the doc but it’s still not working for me at least. My bp is a bit different though.


The print even show the new key but when i go to the input mapping context the key is the same as before. I thought it would be more efficient to use the set members node instead of unmapping and mapping the keys but i don’t think the node is supposed to be used like that ^^

So the input mapping doesn’t appear to update even though you are setting the struct variables by ref.

The print even show the new key but when i go to the input mapping context the key is the same as before

Do you mean in the editor or when you read back the input mapping’s values at runtime?

I thought it would be more efficient to use the set members node instead of unmapping and mapping the keys

I see where you’re coming from but the unmapping and mapping approach sounds sensible to me (if it works).

Have you tried this interface call using the input subsystem? It’s more specific to the player’s copy of the mapping, looks like you’re reading from the “default” mapping so you don’t see the player’s updated binding.

Source from EnhancedPlayerInput.h

image

Do you mean in the editor or when you read back the input mapping’s values at runtime?

Both in the output log and at runtime

I see where you’re coming from but the unmapping and mapping approach sounds sensible to me (if it works).

That was my first approach and the one i usually used before ue5.3 but it didn’t work either. After that i tried to map the new key then set the struct of the key with the old key then unmap the old key but it didn’t work too.
I went from ue5 to ue5.3 directly so i’m very new to this enhanced input system.

Have you tried this interface call using the input subsystem?

This is the closest thing i found to what you have. I tried with that and it still doesn’t work

Sorry, it seems i’m not very good at this ^^

No need to apologise :slight_smile:

That’s essentially what I showed above, though I am using version 5.2 at the moment so perhaps there’s been some changes in 5.3.

Are you calling unmap at the end? You’d want to call that first to unmap the old key, then map the new one.

Here’s an example that’s working for me, I can see the binding is updated in editor view as well, so it must be updating a config file to read the value back.

UnmapAllKeysFromAction may not be desirable either, I just used it here for the example. You may want to stick with UnmapKey for more control on what’s removed.

but I can’t find a way to have the triggers, modifiers, action, etc… to be transferred to the new mapping

@Bugzi Are you putting your triggers, modifiers etc. in the Input Action itself? That way, everything should stay the same even with a new button mapping.

image

1 Like

Yeah that’s the one i used first and it work fine as long as there’s no modifiers to add. But for the move input there’s a different modifier for each keys, that’s why i want to transfer them to the new keys

Here’s what it look like in the input mapping context:

The only option that would work for me is to have 4 differents input action for each direction and set the different modifers directly in them, but that wouldn’t be very optimised. That’s why i’m looking for a way to transfer those modifiers inside the input mapping context like the OP

Okay so i almost resolved the original issue of the post with this:


instead of unmapping and mapping i just changed the key using the set members node.
The IMC node is a reference to the Input mapping context (make sure the get node is a ref not copy or it doesn’t work). And the forward settings node is a reference to the enhanced action key mapping of the forward key i set up during event construct like this:

The key is changed and it keep all triggers and modifiers i can see it in the input mapping context when i change it during play in editor but the problem is that the old key is still in effect until i stop and relauch the game in editor (ex: the old key is W and set the new to T, the key displayed in the input mapping context is T but i still move in game with W)

3 Likes

Nice one :smile:

Does calling UnmapKey after set members work? As in call UnmapKey for the W input once it has been reassigned to T?

If not, maybe you need to force a rebuild/refresh of the mapping with a flush.

2 Likes

If not, maybe you need to force a rebuild/refresh of the mapping with a flush.

Yessss it finally work ! I’ve been stuck on this for 4 days ^^
I just added the request rebuild control mappings node at the end of the remapping code and it worked. That was the node i was missing thanks for the help.

And i guess it also answer the original problem of the post, the difference is that he unmap the old key then map the new then pass the modifiers and all to the new key. And i’m just replacing the key from the mapping with the new one.

Should i make a big reply to resume how to do it both way so that it can be flag as the solution or let future readers look through all the comments ?

2 Likes

Great, happy to help.

In regards to a summary post, I think it’s ok to leave as is since there isn’t a sea of comments to wade through.

Hopefully @Bugzi can mark it as resolved.

@hotinnards @Jairientrouve OMG Thanks guys !! I had lost hope for this one, good thing I came back to check! :smiling_face_with_three_hearts:

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.