If you use a game controller, the input is registered whether you are focused on the window or not. With keyboard, inputs only work if the window is focused. If clicking back on the window doesn't solve the issue, then it doesn't seem like something else is grabbing the focus, but rather...