A simple question

When the game window loses focus, I plan to pause the game and suspend the background music. Is there an event that can let me know that the game window has lost focus?

1 Like

GetSubsystem<Input>()->HasFocus() should do the trick.

1 Like

If your application runs full screen GetSubsystem<Engine>()->SetPauseMinimized(true); should suffice, btw.

1 Like

thank you ,i find InputFocus event can slove my problem.

1 Like

Ah, right, there’s even an event for that. :slight_smile:

1 Like