5.7+ - Enhanced input retriggers existing pressed keys when control mappings are rebuilt for any reason

We are running into issues with enhanced input unexpectedly re-triggering pressed key events when rebuilding control mappings- this could be from adding an input mode, adding / removing an IMC, simply requesting a rebuild with no change, etc.

The issue was called out here: [Content removed] however the scope of the bug reported (or at least the public bug created) there is very narrow- it’s not just from ‘adding the same mapping multiple times’. Any action that will trigger a control mappings rebuild will retrigger currently pressed actions. I can confirm that, as on the other linked UDN, this was introduced by the fix for UE-270589 (that fix just causes existing trigger state to never carry over on rebuild) and disabling ‘input.bRespectIMCPriortyForTriggers’ fixes the problem and it was not a problem in 5.6

An official fix for this would be appreciated. For now we will disable that cvar.

[Attachment Removed]

Steps to Reproduce

  1. Have an input action that triggers a control mappings rebuild in enhanced input for any reason (you can even directly call RequestRebuildControlMappings) on ‘Pressed’.
  2. Notice when you press it it will repeatedly trigger when it should only trigger on the initial press.

To repro with the attached projects.

  1. Load the 5.7 project and PIE in ‘Level’ (should load by default).
  2. Press F, notice it will spam the screen due to repeatedly triggering (due to it enabling the input mapping (via adding an input mode tag) that allows the G key).
  3. Press E, notice it will spam the screen due to repeatedly triggering (due to requesting control mapping rebuilds with no actual changes).
  4. Press Q, this will toggle the ‘input.bRespectIMCPriortyForTriggers’ cvar that introduce the bug.
  5. Now press F and E and notice they won’t spam unexpectedly.
    1. After pressing F you can press G, which is an input toggle by pressing F (due to adding/removing an input mode tag).

Load the 5.6 project- notice that none of these issues occur and none of the keys retrigger unexpectedly.

[Attachment Removed]

Hi [mention removed]​,

Thanks for reporting the issue and for providing the test project and detailed steps to reproduce it. I’ll check whether there has been any fix for this in the current development version of the engine.

Having these projects available will make it much easier for the Epic developers to investigate and work on a fix. I’ll also take a look at the engine code to see if there might be a quick workaround. In the meantime, it’s good to know that disabling the cvar allows you to continue working.

I may also create another report including this additional information and reference the previous issue tracker you mentioned. Once I’ve had the chance to review everything, I’ll get back to you.

Best regards,

Joan

[Attachment Removed]