# \[Bug report\] Losing focus / input axis values 0 after releasing mouse button.

**URL:** <https://forums.unrealengine.com/t/bug-report-losing-focus-input-axis-values-0-after-releasing-mouse-button/819494>\
**Category:** Issues and Bug Reporting\
**Tags:** focus, Input, unreal-engine, bug-report, editor, slate, Widget, Blueprint, CPP, question, UMG\
**Created:** [March 25, 2023, 2:03am UTC](https://forums.unrealengine.com/t/bug-report-losing-focus-input-axis-values-0-after-releasing-mouse-button/819494 "2023-03-25T02:03:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Roy\_Wierer.Seda145](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/roy_wierer.seda145/32/906551_2.png) [@Roy\_Wierer.Seda145](https://forums.unrealengine.com/u/Roy_Wierer.Seda145)\
**Post date:** [March 25, 2023, 2:03am UTC](https://forums.unrealengine.com/t/bug-report-losing-focus-input-axis-values-0-after-releasing-mouse-button/819494/1 "2023-03-25T02:03:29Z")

</div>

Since this was a very popular answer to many very popular questions (it’s a known bug in the engine for a long time), here we go UE5.1.1.

If you lose your input functionality after releasing a mouse button and your input axis floats begin reading 0, you are looking at the following problem:

This is a problem with how your player controller settings are treated in the engine, in the SceneViewport. Apparently if you combine the playercontroller settings "bShowMouseCursor " set to true and the input mode set to “Game”, the viewport will lose focus each time you lift any mouse button, resulting in the axis value reading 0 and breaking your controls.  
This is something which has been discussed over the years but no one came up with a fix.

| | // References: |
| --- | --- |
| | // [I don’t receive player mouse inputs until I click - Programming & Scripting - Unreal Engine Forums](https://answers.unrealengine.com/questions/395313/view.html) |
| | // [MouseX BindAxis returning 0 unless mouse button depressed - Programming & Scripting - Unreal Engine Forums](https://answers.unrealengine.com/questions/260284/mousex-bindaxis-returning-0-unless-mouse-button-de.html) |
| | [Why Axis Value of MoveForward event is 0 when left mouse button event?](https://forums.unrealengine.com/t/why-axis-value-of-moveforward-event-is-0-when-left-mouse-button-event/577686) |

I modified quite a few things in my project, but from memory my workaround to be able to use the mouse in input mode game, is to re apply the input mode whenever the bug triggers:  
**PlayerControler, on event any key:**

```auto
if (bShowMouseCursor && InKey.IsMouseButton() && (InEventType == EInputEvent::IE_Released) && (InputMode == E_PlayerControllerInputModes::Game)) {
	// Simply re-applying the Game input mode seems to do the trick.
	ActivateInputModeGame();		
}

```
