Inputs not working when map loaded from menu

While building my TPS game based on the Shooter example and some code snippets from the TPS template, I faced a very strange problem I don’t see how to solve…
When I launch “Play” on the game map, I’m able to control the character w/o any problem, using the mouse and the keyboard.
But when I launch that same map with the same character, char controller, game mode, etc… from the menu, I can see the char being spawned correctly, but no input is working!
The code is well executing the bind axis/action command as expected (I can see the log), but nothing happens…
In my menu, I have a very basic char controller, as shown in the Shooter example, w/o any character associated.

Any idea where this problem could come from?

In the editor make sure on the specified map that your custom game mode is selected under world settings.

It’s the case, the correct game mode is selected and loaded…

I’ve added a HUD and changed the focus of inputs to the UI when the menu was open, and then to the game when it was closed, and the controls finally started to work!
So finally, I’ve added a “Set Input Mode Game Only” node to the level blueprint, and the controls are working fine.
Is there a way to do the same thing in C++ code?