The problem is about a feature of the EnhancedInput system about ignoring pressed keys till release, specifically when changing active contexts and mappings are rebuilt.(FModifyContextOptions::bIgnoreAllPressedKeysUntilRelease).
In our use case, we have an input context always active, containing an input action IA_Test with trigger Pressed (which should therefore trigger only once till is pressed down).
When removing/adding another input context, while the pressed action has already triggered (IA_Test associated input is kept down the whole time and never released), the action gets re-triggered. even if the flag bIgnoreAllPressedKeysUntilRelease is set true.
From internal tests, results is that a flag value is being lost in the process of recreating mappings of active contexts, specifically in IEnhancedInputSubsystemInterface::RebuildControlMappings, when the flag bShouldBeIgnored of mapping may be lost; a fix has been proposed in the attached image, adding the following snippet just under fix labeled “Fix for UE-270589”, to keep flag value consistent.
This should prevent the bug and ensure the feature works properly.
OldMappings[Idx].bShouldBeIgnored = Mapping.bShouldBeIgnored;
immagine.png(44.5 KB)
TP_Blank.zip(24 MB)