# Set input mode UI only makes inputAxis Value stuck

**URL:** <https://forums.unrealengine.com/t/set-input-mode-ui-only-makes-inputaxis-value-stuck/113580>\
**Category:** Blueprint\
**Tags:** unreal-engine\
**Created:** [July 14, 2018, 12:28pm UTC](https://forums.unrealengine.com/t/set-input-mode-ui-only-makes-inputaxis-value-stuck/113580 "2018-07-14T12:28:44Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![rit](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@rit](https://forums.unrealengine.com/u/rit)\
**Post date:** [October 20, 2020, 8:58am UTC](https://forums.unrealengine.com/t/set-input-mode-ui-only-makes-inputaxis-value-stuck/113580/4 "2020-10-20T08:58:49Z")

</div>

> [@Adolfo\_Domigues](#):
>
> Hi,
> 
> when I use “set input mode UI only” while my character is moving my character keeps moving on his own when going back to “input mode game” until I press W and release W again.
> 
> So for some reason the Input Axis value gets stuck on 1 even thought I am not pressing any key. Until I press and release the key then the Axis value becomes 0 again.
> 
> Is there a workaround for this? Can I reset an Input Axis somehow or anything like this? Thanks for helping 🙂

I’ve experienced the exact issue today.

After digging into the C++ code of UE4, it turns out the engine will stop listening to all game-related registered input after calling _SetInputModeUIOnly()_

```auto

GameViewportClient.SetIgnoreInput(true);

```

Set the flag _bIgnoreInput_ to true, will cause all the axis binding, action binding events be ignored, including the RELEASE event:

```auto

bool UGameViewportClient::InputAxis(FViewport* InViewport, int32 ControllerId, FKey Key, float Delta, float DeltaTime, int32 NumSamples, bool bGamepad)
{
if (IgnoreInput())
{
return false;
}

...

```

Since the RELEASE event is ignored, the key state (axis value) remains the same. That is probably why after changing to _SetInputModeGameOnly()_ the character keeps moving in the same direction until you press the relevant key again (update the old axis value).

A workaround for me is to call

```auto

PlayerController->PlayerInput->FlushPressedKeys();

```

**after** _SetInputModeUIOnly()_ to manually reset the value of all axis bindings and action bindings.

After some test runs, this method seems to fix the issue for me.

I know this is an old post, however, I hope this could help people who experienced the same problem.

Hopefully, this issue is resolved in later versions of UE.

---

_[View the full topic](https://forums.unrealengine.com/t/set-input-mode-ui-only-makes-inputaxis-value-stuck/113580)._
