# bShouldBeIgnored prematurely cleared after FlushPressedKeys in Enhanced Input 

**URL:** <https://forums.unrealengine.com/t/bshouldbeignored-prematurely-cleared-after-flushpressedkeys-in-enhanced-input/2719532>\
**Category:** Programming & Scripting\
**Tags:** Epic-Pro-Support, unreal-engine, question\
**Created:** [March 26, 2026, 5:30am UTC](https://forums.unrealengine.com/t/bshouldbeignored-prematurely-cleared-after-flushpressedkeys-in-enhanced-input/2719532 "2026-03-26T05:30:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous-edc](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous-edc](https://forums.unrealengine.com/u/anonymous-edc)\
**Post date:** [March 26, 2026, 5:30am UTC](https://forums.unrealengine.com/t/bshouldbeignored-prematurely-cleared-after-flushpressedkeys-in-enhanced-input/2719532/1 "2026-03-26T05:30:12Z")

</div>

Hello,

We are experiencing an issue where a phantom Started event is intermittently fired when adding an IMC in a gamepad environment. This occurs when FlushPressedKeys() is called after adding an IMC while the key is still physically held (e.g., via a Hold trigger’s Triggered event).

We believe the cause is that the bShouldBeIgnored check in UEnhancedPlayerInput::EvaluateInputDelegates (EnhancedPlayerInput.cpp) only checks bDown:

```auto
if(Mapping.bShouldBeIgnored && KeyState)
{
   if(KeyState->bDown)
   {
     continue;
   }
   else
   {
     Mapping.bShouldBeIgnored = false;
   }
 }

```

FlushPressedKeys sets bDown=false without generating an IE\_Released event. This code treats the logical release the same as a physical user release, prematurely clearing bShouldBeIgnored. When bAutoReconcilePressedEventsOnFirstRepeat subsequently restores bDown=true via IE\_Repeat, the mapping is no longer protected.

The reason this issue is intermittent depends on whether OS IE\_Repeat arrives before the next EvaluateInputDelegates tick. Gamepads have a longer polling interval than keyboards, making this issue more likely to occur.

Normal case:

1. Frame N : AddMappingContext → bShouldBeIgnored=true → FlushPressedKeys → bDown=false
2. Frame N+1: OS IE\_Repeat arrives → AutoReconcile → bDown=true
3. Frame N+1: EvaluateInputDelegates → bDown=true → continue (protected)

Phantom case:

1. Frame N : AddMappingContext → bShouldBeIgnored=true → FlushPressedKeys → bDown=false
2. Frame N+1: OS IE\_Repeat not yet arrived → bDown=false
3. Frame N+1: EvaluateInputDelegates → bDown=false → bShouldBeIgnored cleared
4. Frame N+K: OS IE\_Repeat arrives → AutoReconcile → bDown=true
5. Frame N+K: EvaluateInputDelegates → bShouldBeIgnored=false → phantom Started

We are planning to apply the following fix in our project:

```auto
if(KeyState->bDown || KeyState->bWasJustFlushed)
{
   continue;
 }

```

bWasJustFlushed is set to true after FlushPressedKeys, and is only reset to false when InputKey(PlayerInput.cpp) processes the first OS event for that key. This defers the clearing of bShouldBeIgnored until an actual OS event arrives, preventing premature clearing.

Is this the right approach, or is there a better way to distinguish a FlushPressedKeys reset from a natural release in this context?

Thank you.

[ReproProject.zip](https://forums.unrealengine.com/uploads/short-url/nEgRuSg9lCqhDIMlknBYODxMKNH.zip)(59.6 KB)

---

<div class="post-metadata">

**Author:** ![anonymous-edc](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous-edc](https://forums.unrealengine.com/u/anonymous-edc)\
**Post date:** [March 26, 2026, 5:30am UTC](https://forums.unrealengine.com/t/bshouldbeignored-prematurely-cleared-after-flushpressedkeys-in-enhanced-input/2719532/2 "2026-03-26T05:30:16Z")

</div>

**재현 방법**  
1. Hold gamepad B button to trigger “IA\_OpenWidget” (Hold trigger)

2. On IA\_OpenWidget Triggered, add WBP\_Dummy widget and call AddMappingContext with bForceImmediately=true, bIgnoreAllPressedKeysUntilRelease=true

(bShouldBeIgnored=true)

3. Game logic causes FlushPressedKeys to be called (e.g. viewport focus loss due to widget focus) (bDown=false)

4. On the next frame, EvaluateInputDelegates sees bDown=false and clears bShouldBeIgnored

5. When OS IE\_Repeat arrives a few frames later, bAutoReconcilePressedEventsOnFirstRepeat injects IE\_Pressed → bDown=true

6. Since bShouldBeIgnored is already cleared, the action instance fires a phantom Started

---

<div class="post-metadata">

**Author:** ![BenjaFriend22](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/benjafriend22/32/915021_2.png) [@BenjaFriend22](https://forums.unrealengine.com/u/BenjaFriend22)\
**Post date:** [April 2, 2026, 1:36pm UTC](https://forums.unrealengine.com/t/bshouldbeignored-prematurely-cleared-after-flushpressedkeys-in-enhanced-input/2719532/3 "2026-04-02T13:36:49Z")

</div>

Hi there! Thank you for this details repro case and project. I have filed [https://issues.unrealengine.com/issue/UE\-372464](https://issues.unrealengine.com/issue/UE%5C-372464), which you will be able to see once it goes live.

Your proposed fix looks reasonable to me and I don’t think would cause any issues.

Thanks again!

---

<div class="post-metadata">

**Author:** ![anonymous-edc](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous-edc](https://forums.unrealengine.com/u/anonymous-edc)\
**Post date:** [April 13, 2026, 4:47am UTC](https://forums.unrealengine.com/t/bshouldbeignored-prematurely-cleared-after-flushpressedkeys-in-enhanced-input/2719532/4 "2026-04-13T04:47:15Z")

</div>

Thanks for the help. We can close this ticket now.
