Have you ever pushed the mouse to the edge of the screen during a game, only to have the cursor slide onto the other monitor, and one click sends the game window to the back? It happens a lot with dual monitors.
Why it happens
When you run a game in windowed mode or "borderless windowed" mode, Windows treats the game like any other window. So the cursor crosses the screen edge freely. In true full-screen mode it usually doesn't, but switching windows gets slower and it's hard to look at the other screen.
Things to try first
- Check the game settings: Some games have an option that keeps the cursor inside the window. The name varies by game.
- Switch to full screen: If you don't often look at the other screen, this is the simplest fix.
- Change the monitor layout: In Settings > System > Display, offset the two screens vertically so the path between them is narrower. This does make it less convenient to move between screens normally.
Windows itself has no setting to lock the mouse to one screen.
Lock and unlock with a shortcut
With sik2 WinHelper running, one shortcut locks the mouse to the current monitor, and the same shortcut unlocks it.
- Lock or unlock: Ctrl+Alt+M
- Move to the same spot on another monitor: Ctrl+Alt+N
- You can change the shortcuts in the settings, and closing the app also releases the lock.
"Pause during games" is on from the start. In true full-screen games, or games that capture the mouse themselves, the shortcuts take a short break. In those games, the mouse doesn't slip onto the other screen anyway. In games that don't capture the mouse, like borderless windowed games, you can use the shortcuts as usual.
It's free and has no ads. It sits small in the notification area at the right end of the taskbar, so you can leave it running and forget about it.