I lose the ability to make inputs after gamepad disconnects

Hello, I am currently working on a game right now and I’m trying to solve this bug where when I disconnect the gamepad, it’ll continue processing the last input, and it’ll ignore any other input I give from say a keyboard or mouse.

I tried looking everywhere for a function that would clear the input stack but I can’t find anything. The closest thing I found was PlayerInput’s FlushAxisBindings(), but while I stop moving, I still don’t have control again.

Has anyone ever run into this problem? How did you fix it on your end if you did, because I feel like I am going on a wild goose chase trying to find something to fix this. Help would very much be appreciated.

Edit: Oh, and I tried reconnecting it, that doesn’t help.

Hi, I’m running into the same exact problem with my project in 4.18. Have you find a solution to this? If so please share it. ^^

EDIT:
I’m currently running in some investigation myself, and I found out that if I run a new project using the Third Person template, inputs are managed correctly: when I disconnect my controller, the Pawn stops, when I reconnect my controller I have my input back.

Hope we can find a solution to this.

If you download the shooter game sample, check out their game instance cpp class.
you can see that they have a delegate bound to controller connection changes. (HandleControllerConnectionChange)
if you implement this type of delegate, you can write a function which cancels or intercepts input on connection change such as a disconnect.