Is there a way to force the mouse to be confined to an arbitrary window in windows 7?

2

1

I have a multi-monitor setup, and run almost all programs in windowed-mode. This works great for the most part, but is problematic when some applications, or even webbapps, use the position of the mouse inside the window for interfacing. When I inevitably get sloppy, move the mouse too far, and click, the window I was working with looses focus, and all kind of weird things happen with the action I was trying to achieve by clicking.

What I want to do is tell windows' desktop manager that untill I tell it oterwise (say by leaving the application by alt-tabbing), the cursor should not be able to leave a selected window. Is that possible? If not, can the same effect reliably be achieved with third party applications?

simonra

Posted 2015-05-22T14:20:57.697

Reputation: 135

Answers

2

You could try WMC, aka "Warcraft III Mouse Capture":

WMC is an extended version of Warcraft III Mouse Capture. It allows you to lock the mouse within a specified window (not just limited to Warcraft III).

The primary use of this program is to have a game (in window mode) on one monitor and applications such as IM and internet browser on another. Without WMC if you move your mouse to the edge of the screen while playing your game, your mouse will just leave the game. You wont be able to aim!

You have to manually pick the window you want to lock to (one window at a time), but it may get you at least part way there. :)

Ƭᴇcʜιᴇ007

Posted 2015-05-22T14:20:57.697

Reputation: 103 763

It works rather well, however there is a small issue where the window gets deselected when you move or resize it. When you move it, it seems that it can be selected again, but when I've resized it I can't get the mouse captured again without going through the process of selecting window to be captured again. But it is a rather insignificant issue given the convenience of how well it works, and that the combination of an obscure use case and an extreme edge case is where it breaks, so I'll mark it as accepted =) – simonra – 2015-05-24T21:55:30.770

1

Borderless gaming (https://github.com/Codeusa/Borderless-Gaming) has an option called "Use Mouse Lock Hotkey (Scroll Lock)" which confines the mouse cursor to the currently active window. In my testing, confinement stops when you press scroll lock again or when you alt-tab away from the application.

Aaron Rawson

Posted 2015-05-22T14:20:57.697

Reputation: 11