Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

How to prevent a game from pausing when minimized?

A topic by dahus created 32 days ago Views: 262 Replies: 3
Viewing posts 1 to 4
(1 edit)

How to disable game pause after minimizing. I want to make it so that it continues to work in the background.

Not the answer you want to hear but a second computer with the game running on it

I think virtual machine workaround could help. VurtialBOX is pretty lightweight

Here's what I found for Windows:

https://github.com/araghon007/NoFocusLoss

Seems to allow the game to keep running like normal, even when minimized.  (Because it's an injector, don't run it with any anti-cheat games!)  Seemed to work for me.

Here's a bonus:

https://github.com/nefares/Background-Muter

Mutes all sound to non-selected applications.  So you could have the game muted until you select it.  (Might want to disable the Autostart option under settings?)  Seemed to work fine with NoFocusLoss.


Unfortunately, I couldn't come up with a good solution to lock keyboard input... So even when the game is minimized, if NoFocusLoss is running, you could be accidentally accessing the save menu and overwriting your game...!

The only working solution I can think of, would be to rebind your in-game key to something you don't press?  Or maybe you can edit a config file directly and bind the keys to null?... Assuming you have a controller or something that can still control the game.  Maybe the mouse would be good enough?

I found potential solutions, but I couldn't get the most promising one to compile.  I.e.:

https://stackoverflow.com/questions/71363441/block-keyboard-and-mouse-events-fro...

Other failed solutions were LiteLockr (locks the app, but fails with NoFocusLoss active after activating on a non-locked window), HidHide (It didn't seem to work for Lona?), and some autoit scripts seemed to fail.  Frustrating...