Enhanced input hierarchy?

Hi - playing around with the new enhanced input control system. Love the possibility to remap inputs by switching the mapping context, but I wonder if it is possible to create a mapping context hierarchy?

Case in question; I have a top-down type RPG camera going, and I want the camera controls remain the same despite switching contexts between “unit placement”, “unit ordering” etc. etc.

As my understanding is now, I need to clone my context and that is a bummer if I later decide to change the way the camera is controlled - then I have a lot of contexts to change and hopefully I do not screw up in one of them…

So what I wonder is if there is a way to combine input contexts using blueprints? I.e. either through some kind of inheritance or if a context can be created from two others? In other words, I would somehow have a “camera control context” and then add on “unit placement” when spawning units and then switch that one to “unit ordering” when an existing unit is selected.

1 Like

You can have multiple contexts active at a time.

So just make one context for your camera controls, which you add in the BeginPlay event and then just add and remove the other contexts as you see fit.
You can also give your camera controls higher or lower priority in case you want your other contexts to either come second or first, in case of clashing.

Hope this makes sense, as I don’t think there is any way to “inherit” a context.

2 Likes

Ok - so I can have two contexts active simultaneously? That had eluded me, but I see that there is indeed a priority and the documentation of “Add Mapping Node” kind of hints at that! Thank you!

1 Like