When launching a packaged game that forces fullscreen mode, mouse and keyboard focus is still at windows desktop until mouse is moved into game window and clicked.
This is a small annoyance on a single monitor setup, but a big issue on multi monitor or VR setup. In VR mode you will not notice the mouse moving around on your desktop.
If I do the same steps in UE4.6.1 and earlier the game launches in full screen mode and keyboard and mouse inputs are immediately sent to the game, and not to the desktop.
I just compiled the latest 4.7 engine from Github today hoping that this bug was fixed by now. While testing I noticed that this issue is not just limited to fullscreen mode. Windowed gaming is also unable to gain focus at launch.
I really hope this bug will be fixed for the final 4.7, because I don’t want to release a commercial game that launches without game focus.
Thanks for your concern. I can confirm that this is still being investigated by engineers as to the cause and best solution for the bug, unfortunately it’s difficult to estimate an exact time frame as to when the fix will be implemented.
Adding a “Set Input Mode Game Only” node on Begin Play will force the mouse and controls to the game window on launch. This will effectively overcome the “first click” issue.
Adding a Set Input Mode Game Only doesn’t work for me. Anything else to try? I have the engine source code, I could attempt to fix the code if I knew where to start. I have a VR app and I’m calling the fullscreen command in blueprints on launch if that makes any difference.
Where did you add your Set Input Mode Game Only node? Also, did you have a reference to your Player Controller connected to the Target pin? Doing so should lock the mouse to the viewport and allow immediate input of both mouse and keyboard.
Tried this in the Driving Game sample project with 4.7.3 - it did not work. The game launches to fullscreen (-FULLSCREEN command line) but needs to be clicked once to accept gamepad inputs. I placed the Set Input Mode Game Only node as the first execution step for On Begin Play, connected the Player Controller to it and then routed that to the Delay and Play Sound at Location nodes that ship with the sample.
Does the game window get initial focus when running standalone from the editor rather than running the command line? What about if you use the command ‘fullscreen’ rather than ‘r.FullScrceen 0’ in the level blueprint? Also are you running the command line of the editor project or of a packaged game?
I’ve been trying this with a packaged game: Win64 debug. I tried launching the game with -FULLSCREEN but didn’t get exclusive fullscreen which is why I put the console command in there. The game launches, goes full screen but it doesn’t accept gamepad inputs and you can see a mouse cursor. Click once and then you’re in and racing with the gamepad.