Input binding keeps firing when key is released

If you set up an input axis binding (i.e. keys WASD) to a function, there is a situation in which the binding can continue to fire when the key has been released. For the next example, assume ‘W’ is a direct call to something like AddMovementInput(FVector::ForwardVector…);

Reproduction steps:

  1. Start game in windowed mode

  2. Hold ‘W’ to start moving.

  3. Click off the window

  4. Release ‘W’

  5. Click back inside the window

Expected outcome:

Either the character stopped moving whenever the window lost focus or the character stopped moving when the window regained focus.

Actual outcome:

The character will continue to move forward.

This is due to the engine not getting the release-key callback. The obvious fix, would be to do a quick sanity check on input events whenever the window gets focus again, or fire all key-releases on the window losing focus.

Hey -

After creating a new project I created a character with a movement function (AddMovementInput) as you described. When playing in the editor (PIE and standalone), using Shift+F1 to regain use of the mouse will cause the player to immediately stop moving. Can you elaborate on the reproduction steps in case there is something I’ve missed? Did you create your own movement function or did you see this behavior with the default movement functions that are part of the ProjectNameCharacter class?

Cheers

Hi ,

Thanks for getting back with me. I am at the office now so I don’t have a solid repro on hand, but my game window initialization came through command prompt, i.e:

UE4Editor.exe MyGame.uproject /Game/Maps/MyMap?game=MyGameInfo -game

If you still can’t get a repro through that, I will see if I can narrow down a small sample that highlights the issue.

Thanks,

Hello,

I have been able to reproduce your issue, and have entered a bug report (UE-27080). Thank you for your report. I will provide updates on this issue as they become available.

Have a great day

This issue is present in 4.11.2
With 4.12 officially out, and 4.13 underway; I just wanted to see if there was any update on the state of this issue or projected fix release?

I have the same problem, and don’t want to waste time overriding the viewport client lost focus functions if this is going to be in a coming release (or fixed already).

Hello,

This issue has been reported as fixed in 4.12. You can find more information on our public bug tracker. I’ve linked the specific issue below.

Have a great day!