Cursor Lock is a utility program that confines the mouse cursor to a selected area on the screen. This is most useful in multi-monitor setups, addressing a common oversight in some applications (mostly games) whereby they allow the mouse cursor to drift into other unwanted screens. In video games, this can also lead to minimizing the game window if the cursor has drifted into another screen and the mouse is clicked accidentally. Cursor Lock can also overcome cursor drifting problems in windowed applications and games.
Here’s a list of games that Cursor Lock is reported or confirmed to fix.
Features
- Locking only when focused–requires no special user interaction, nor does it interfere with task switching between screens
- Uses a superior method of capturing the cursor compared to other solutions (e.g. MouseTrap)
- Ability to open one program and lock another allows Cursor Lock to work well with launcher programs
- Can confine the cursor to window borders, in addition to a whole screen
- Customizable hotkeys allow for complete control of locking in any situation
- Alternate locking modes that run in the background for full user control and special circumstances
- Intuitive GUI support program for quick setup of Cursor Lock shortcuts
- Integrated help system for shortcut setup program
- Highly optimized and efficient locking program that uses practically no memory or CPU
Tutorial
Screenshots
Download
Contribute
If Cursor Lock has fixed a game or two for you, consider supporting development with a donation.
Changelog
2.6.1 – 9/15/13
=GUI(1.6.1)
-settings are now saved to config when creating a shortcut
-improved hotkey entry
=Lock(1.2.2)
-performance improvements
2.6 – 7/3/13
=GUI(1.6)
-support for Windows Vista/7 and UAC
-cleaned up help text
-added support for translations
-icons and other UI improvements
-moved context-based help to tooltips
-converted project to .Net 3.5
-logging is now disabled by default
-updated links
2.5.2 – 5/9/12
=GUI(1.5.1)
-fixed a bug with creating shortcuts for user strict mode
2.5.1 – 10/10/09
=Lock(1.2.1)
-fixed a bug with argument passing where the program executable wasn’t given as the first argument
2.5 – 12/14/08
=Lock(1.2)
-added user and strict user modes
-added window and window interior lock regions
-code cleanup
-minor bug fixes
=GUI(1.5)
-redesigned layout to be more intuitive
-added settings for the new switches
-added about tab
-added test and self-test functions
2.11 – 1/2/08
=GUI(1.21)
-fixed a rare bug that occured when creating shortcuts to some programs with invalid filename characters in their program name
2.1 – 11/27/07
=Lock(1.1)
-Optimized the polling code to reduce the CPU usage to inpercievably small amounts while the program to lock still has focus
-at least 10x less CPU
2.0 – 11/11/07
=GUI(1.2)
-removed the lock code and set shortcut targets to the new lock app
-made sure any shortcut arguments with spaces have quotes around them. \” escapes
-added the /s switch
-removed memory minimize (/m) switch, since the new lock app doesn’t support it
=Lock(1.0)
-initial release – complete C++ rewrite of the command-line driven lock monitor
1.1 – 10/22/07
-added the /s argument, which locks the cursor to the current screen
1.0 – 2/12/06
-added hotkeys for toggling lock and exiting the lock program; should work with most keys except F10, Tab, and PrintScreen. Non-standard US keys will probably appear as a number.
-added arguments parameter for opening programs.
-added lock program parameter, allows for opening a program and locking another and locking without opening.
-added hotkey override parameter.
-better checking for valid text parameters.
-better log formatting for time.
-added help text for new elements
0.9: Initial Release
I want to use this for Minecraft Dungeons, but I don’t want to play on fullscreen. The problem is that if your cursor moves outside of the windows when playing, your character moves in a random direction and it’s really annoying. When I try to use the program, it works and my mouse won’t move out of the window, until i press any button, and then it stops working.
You’ll want to set it to “Window Interior” in the default options.
Well it was set to that, and it worked fine until I pressed any button.
Hey Dude,
fyi: Rocket League recently got updated where a patch broke the mouse lock.
I used your program and it works flawlessly in program mode. My thanks
If you have a reddit account, there are a few souls in need of your tool (on the rl syubreddit), if u are looking for upvotes and pub. ^^
So I don’t really get this program. I’ve installed it and tried to make a shortcut for Chrome and a User Mode Shortcut but they seem to do nothing. My hotkeys are shift + num plus for activating, shift + num minus for deativating and shift + num multiply for “cycle lock region hotkey”. Did i choose the wrong hotkeys or is the program simply not made to operate in chrome but only in games? im not using more than one monitor, but nonetheless i need to be able to set a specified region for mouse movements within a window of my browser. Is this not supported or am i doing something wrong?
It works for chrome fine. I just tried it. Use the “Test” feature to make sure you’re setting it up right.
I installed cursor lock for Baldur’s Gate EE. I got the set up right and my cursor is locked to my second monitor but it doesn’t move my screen when I go to edges like it should. So the view off my screen is locked because I cannot go left, right, up or down. I hope I am making myself clear and you know how this can be fixed.
Thank you!!
Move your screen? I’m not sure you understand what Cursor Lock is for.
English is not my first language.
Let me try to explain better.
In Baldur’s Gate when your cursor touches the edges of the screen the map moves up and down, left and right so you can click to move your characters.
With cursor lock it doesn’t do this anymore. So I cannot play the game since the screen “doesn’t move”.
I hope you understand what I mean.
I see. I would try using a different lock region. You can use the “cycle region” hotkey while ingame to test this.
Does not appear to work for State of Decay 2, windows store version. More specifically, even containing within the window is insufficient. On a window smaller than desktop I can see the cursor at the very edge slightly escape the game area but still confined in the ‘window’. Confined area needs to be about 5px smaller on each side I reckon.
I have an issue where if my mouse is at the edge of the screen and I click a few times, it makes its way out of the window, even with the poll rate adjusted. is there any way to keep the cursor away from the very edge?
Hmm…you might be resizing the window accidentally? Make sure you lock to the “window interior”.
I’m currently trying to use this to play Skyrim LE, but it seems that the locking doesn’t work after I start the game through the SkyrimLaucher (CursorLock) short cut I’ve made so that when I start up SKSE through Steam that it locks the mouse in the window. Did I do something wrong?
If I remember correctly, you use the SKSE executable as the “open program”…at least for vanilla Skyrim that was the case.
I couldn’t get this to work initially using a NWN in Windows 10. I’m not sure if it had to do with the NWNCX loader that I had set up. I managed to get it working by giving the NWNCX loader, NWN main.exe, and Cursur lock all Windows Xp Service pac 2 With admin control. I”m not sure if it is all necessary but that is how I got it work.
I used this for Gears of War 4 and it worked great, the next day I went to play again and it won’t lock the cursor at all in any program. I had to use the hotkeys because UWP games (or at least GoW4, it’s the only one I own and the last one I’ll buy) don’t work like normal programs, but the hotkey combination no longer locks the cursor, and no other hotkey will work either. Any suggestions? I’m on windows 10 up to date.
Hmm…what mode were you using? Maybe check the log file to see if there’s any clues there.
OK I’m an idiot, I was using the Setup Cursor Lock shortcut instead of the Start User Mode shortcut, it’s working fine now.
Hi. I’ve checked the game compatibility list mainly because I play Skyrim Special Edition. I know the list shows Skyrim as reported but because special links needs to be created by the app to lock the cursor, I’m not sure how this would work.
You see, I have over 50 mods installed using Vortex. For a good number of mods they require Skyrim Script Extender to run which is a separate .exe file. Vortex is just a GUI front end. I could run SSE64.exe from Windows Explorer without Vortex and the mods would still work.
The problem is, SSE64.exe first runs, starts SkyrimSE.exe with a modified script, then unloads from memory. Whether I run the game in windowed mode or fullscreen, the cursor still drifts across to my other monitor. Even though the cursor is invisible, if I use the mouse wheel to scroll through menu options, if the windows cursor location is on my second monitor it’ll manipulate the open app on that monitor in the normal fashion a scroll wheel would (such as scrolling up and down a webpage).
Since 2 separate .exe files are run, could Cursor Lock be setup to recognize when more than one .exe is used to run a game even if the 2nd .exe is called by the 1st .exe automatically and independently?
Yes, this setup will work. You want to choose a different executable for the lock program and open program settings. You’ll find more information about using this setup in the documentation under “Usage Guides > Typical Usage with Launchers” and in the following post: http://www.snakebytestudios.com/2017/04/cursor-lock-faq-and-future/
I will admit this took me a little while to figure it out, but I got it working properly. Thank you. I spent around 30 minutes in Skyrim just running around and getting in random fights and can confirm this works. Great job.
Makes me wonder if you can do it in a tiny little app, why are devs too lazy to implement a better mouse lock in their games? 🤷♂️
You, sir, are a knight in shining armor. This is the perfect app I’ve been looking for. 😁👍
Mostly from crappy console ports, I believe.
Cheers, mate. 360 no scope a mudcrab for me.
Thank you so much! The utility worked on Baldur’s Gate Enhanced Edition like a charm at the first try, it’s just perfect! Feature rich, highly customizable, very clear instructions and highly supported, couldn’t ask for more… good job!!!
Hey Snake, This may seem like a dumb problem and im probably missing something very simple, but How do you change the hotkey for the cursor lock? Its currently enter and it gets in the way with me typing, so most the time i cant sent anything. Ive tried Changing it by rebinding it in Post and Pre setting up the shortcut, im just at a loss. Thank you!
Not sure how you managed to change the hotkey to Enter, but to further change the hotkeys, you go to the Cursor Lock Setup program and then the hotkey tab.
Yo this works for Rainbow six siege its perfect 😀
I’m trying to get Cursor Lock to run on most of my Windows programs. Do I really have to create a special shortcut for every one of my programs? Cann’t I just tell Cursor Lock to apply to all running programs, perhaps with an exceptions list? Or just give it a list of programs to apply to?
Just use the shortcut that’s called “user mode” and control it via shortcuts. Yes, if I was able to, I would update Cursor Lock to stay in memory all the time and remember the programs you wanted locked. But back when I made it, everyone didn’t have 16GB of RAM. 😛
Thanks for the reply, Snake!
Hi Snake. I tried using “user mode” and that does the job of making it work for all windows. The only trouble is, it also works with Explorer windows. I really would like to exclude them. OR to make Cursor Lock only apply for programs that are maximised. Is there any way to do this please?
how do we get this to work for league of legends i cant find anything about it
I’ve been using this for Overwatch and it’s saved my life because I get really bad simulation sickness and need to play in Windowed Mode. However, as of the most recent update to Overwatch, the cursor is now able to drift out of the window, though it does quickly snap back. I’m not sure what is causing this or how to fix it, any advice? Thank you so much for this software!
Increase the poll rate?
That seems to have fixed the problem functionally, but the mouse is still able to exit the boundaries of the screen (if only for a single millisecond). Ah well, it works fine enough – thank you for the reply!
How can I lock the mouse pointer to a custom area on the screen ?
I would like to know this too
Snake, been using your app for a few years now and it does everything I’ve needed it to do do…until now.Out of the blue, when I minimize my screen, my curser wants to grab the left side and drag it in if I’m anywhere near it.Can’t find a fix for this. Also, your software isn’t showing up as installed software on the computer (Windows 10) so I can’t uninstall it long enough to see if a reinstall would fix my problem.
hey man, could you make a tutorial or something for overwatch windowed mode? im not talking about borderless windowed, and i also play on one screen. please help me, also there isn’t a app id for overwatch.
Dude you are awesome fixed Battletech for me on my multimonitor setup, wish i’d known about this earlier will fix so many games <3
I cant figure out how to make the hotkeys work. I’ll set one up but them when im in the game I cant use the hotkey.
tried to use for jagged alliance 2, cursor lock just does not work. only works in its own test window
hey, is there a way to update your program in a way that forces the mouse into the middle of the window? i used it with the witness and when i alt+tab and come back to it, the curse is still locked to the window but i am still able to click out. also able to click out if the game is in fullscreen mode.
I have four monitors but I don’t use them all, all the time. It’s annoying to lose the mouse cursor to a monitor which is turned off so I’d like to be able to restrict the mouse to the monitors which are in use. There are plenty of solutions to restrict the mouse cursor to any particular single monitor but I want it to be able to move the cursor across multiple monitors and use hotkeys to toggle which displays are included.
Makes sense, but Cursor Lock doesn’t support this. Maybe in a future version.
I’m using SoftTH with LoL and it disables the native screenlock, and Cursor Lock fixes it beautifully so thanks! Just wanted to point out that my Panda Antivirus detected both exes as viruses. I assume it’s a false positive, probably similar code as viruses to be able to hook into other apps? Removed them from quarantine and works fine for me but might push back some users. Just as an fyi if you’re able to do something about it.
Yeh, virus scanners do that on occasion. Not really worth it for me to worry about it. False positives should be on the virus scanners to fix, anyways. But thanks for the report.