How to get a list of all currently active Input Mapping Contexts - Enhanced Input

UE5.4:

There is no way to access a list of all added IMCs + their priorities. In UEnhancedPlayerInput is a getter for that
/** Note: Source reference only. Use EnhancedActionMappings for the actual mappings (with properly instanced triggers/modifiers) */
const TMap<TObjectPtr, int32>& GetAppliedInputContexts() const { return AppliedInputContexts; }
but it’s “protected”.

As we can add, remove, search for etc. added Input Mapping Contexts (via functions in IEnhancedInputSubsystemInterface), it would be great to also just get a list of currently active IMCs incl. their priority.

Please add public getters for currently added Input Mapping Contexts + their priorities (Enhanced Input System), as in some cases you deal with several IMCs at once and want to unload them partially or all at once and restore the state before removing them (partially or not) at a certain state.
After searching for posts by other users I found at least 1 pointing to a similar issue for Blueprint - no access to the list of added IMCs. Please add support for BP as well.

5 Likes

If it is protected, you can derive from that class and add your own getter.

Thats true. But why is there this protected getter? I’ve searched the whole solution and there is no single use of this getter. There are some friend classes that directly access AppliedInputContexts. As it looks like from my side: some getters are intended to be public, but they are just protected by accident.

1 Like