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
Seems to work for CK3 (Crusader Kings 3)
Just make a shortcut to the executable in steam apps/common/ck3/binaries
Why did you stop updating it after 10 years?
I’ve gotten very sick, so I mostly don’t code anymore. Mostly.
I wish you the best
bless up
Why all the Hotkeys do not work? “Toggle Lock Hotkey” is the one I need most, I set it to “Win+Esc” and I’m pretty sure it doesn’t conflict with other programme, but it just can’t unlock.
I just downloaded Dawn of War on steam. I can confirm this worked perfectly! Thank you
using or trying to use through xbox but not knowing how to find the exe. through xbox launcher. cloud streaming the game and don’t know how to step it up properly.
help
How do you keep the program when I restart the computer to keep the settings?
Hello, I liked your app, can I a suggestion make a windows startup because my battle.net requires not the shortcuts. I can do the shortcuts but it’s always asking for on the account that way.
There are many ways to have programs run at Windows startup. One way would be to create a shortcut with Cursor Lock and save it to the Start Menu > Startup folder.
Hello I like your program, very neat. Maybe even suggest let be you put a startup with windows and Blizzard games usually from the Battle app, so you can’t use a shortcut for the games.
Thanks works perfectly with shortcut and V Rising (-applaunch 1604030)
I AM ABSOLUTELY ECSTATIC TO SAY THIS WORKS WITH APEX LEGENDS! THANK YOU SO MUCH! I play fullscreen on 16:10 so im constantly clicking out when hitting boxes and minimizing my game! you just helped me out so much!
I downloaded this because I am trying to play “The Settlers – Heritage of Kings History Edition” on Steam without my mouse moving out of the window over to my second screen. Nothing has been working so far, no matter what I tried.
Is there any way for you to help me out? I would really love to play the game like in my good old days :c
Perhaps, if you can explain the exact trouble you’re having. Make sure you read the FAQ first.
To put it simple, the program does not change anything, which might also just be my own stupidity.
There is this new official Windows package manager that is called winget. I think it would be really cool if Cursor Lock could be downloaded from the community repository:
https://github.com/microsoft/winget-pkgs
I don’t really understand what the benefit of this would be…?
I like to install the software on a fresh Windows PC with scripts and package managers like chocolatey and winget. So that’s my reason, but it’s fine if you don’t want to that.
it works on SNOWRUNNER https://www.youtube.com/watch?v=UrabnfWMLqs
Also tested it myself! ty, since f Snowrunner does not lock on its own
BUT may i suggest a “auto run” option too?
I figured i might check OPEN program and LOCK program or so but~ no such luck
I’d love icons i click, its locked, and the game boots
Hi. I’m about to try your program for the first time with the Ghostbusters: The Video Game Remastered. I’m in the process of downloading it, and I have a question. Is this a portable program? If I install it to a folder and then want to copy paste the program folder to another computer, will it keep all my settings and still work? Or will there be missing files and folders from other locations?
Ghostbusters: The Video Game Remastered… is this a remake of the original NES game? 😄
As far as being portable…well, yes and no. Settings are saved to a file in the program directory, so that should be easily portable. Shortcuts on the other hand will require that Cursor Lock be installed to the same path on both systems if you plan on copying those as well. There’s no program dependencies other than .Net 3.5 being installed, so installation is not strictly required unless you want the Start Menu shortcuts made for you.
Thanks for the reply and information. Sorry, I don’t now much about the origins of the game. I think that it was first released in 2009 and then it got a remake sometime later, but it’s pretty buggy. Mouse cursor doesn’t stay in the window and I had problems with cutscenes freezing and not being in sync, and the strange thing is I think the cutscenes “almost” work on an integrated GPU but won’t play right on a dedicated card.
Nevermind. I think that your program only works with some games. I was using User Mode and hotkeys and it would not work with Ghostbusters (Remastered). Oh well.
Hey do you plan on making this Opensource, like put the source code all on GitHub?
Nope. I have some smaller projects on github, though.
A couple days ago for no particular reason an error starting popping when trying to create a shortcut, anyone got a clue about that?
What is the error? Does it happen when you click “Create Shortcut” or when you click “Save”?
Happens when i click save, says <>
Huh… maybe try saving to a different place or running as admin.
Otherwise, I really don’t know. I looked at the code, and it literally just passes the shortcut parameters to the Windows Script Host Shell CreateShortcut function after you click “Save” and on failure should give an error message of “There was an error creating the shortcut. You may have to make it manually.” Makes me think there might be something outside of my app at fault for you.
I am having the same problem. Opening “Start User Mode” shortcut via file manager does not do anything: It shows “Cursorlock.exe” is running in Task Manager yet nothing has been locked/hot keys have no effect.
Running “CursorLockSetup.exe” and manually switching to User Mode, and using “Test”/”Self Test” feature works: cursor is locked within the “Cursor Lock – Setup” window. However all hotkeys do not work.
I have been locking “Window Interior” for all my tests.
Hmm… what OS?
Scrolling through the comments I noticed a mention of a custom lock region, I’ve been scouring the internet for a feature like that. Any idea when you’ll plan to add it? Preferably with a definable region similar to picture related, https://puu.sh/Hnau0/6a0b826d4e.png.
Somewhere between never and ASAP. I have a chronic illness–I don’t do much anymore. Make me an offer I can’t refuse…? Otherwise… my apologies for getting your hopes up.
I am trying to use Curser Lock in User mode in conjunction with Nomousy. I am trying to hide the cursor once it’s locked on a window (Lightgun game in Windowed mode). It looks like there is a conflict and Nomousy is unable to hide the cursor when using the Cursor Lock /C command. I use /C to prevent the “Close previous Cursor Lock..” message from appearing when launching the unlock app after closing the emulator.
Is there a way to launch the Unlock app and not have the “Close active instance” msg box appear?
Or ..Any thoughts on adding a hide cursor capability similar to Nomousy?
Thanks!
If you’re using User Mode, you should be controlling Cursor Lock with the hotkeys, not launching it repeatedly. So, try that. Just enable it when you wanna play your game, disable it after. Tide goes in, tide goes out, you can’t explain it.
Is there a way of letting it choose an open program? Sea of Thieves has this terrible issue where in full screen borderless, the task bar and the top of the window will appear if you scroll down or up enough. Microsoft being Microsoft, there is no .exe for Cursor Lock to launch – it’s launched through the XBox companion app and does it’s own thing.
Ugh..Microsoft creates such dumbed-down garbage these days. Not sure if cursor lock will help with your particular situation or not, though, as i’d assume fullscreen borderless is already the maximum size of the screen. But there’s always an executable to lock to, even if it’s the entire xbox app as you say (google up “process explorer” if it’s eluding you). Or just try cursor lock in user mode for a quick test of if it can fix your issue of not.
There’s still an exe somewhere, the Xbox app just hides it under a folder and denies you permissions by default. You can still grant yourself access to it though. My installs are under D:\WindowsApps.
Wondering if this can allow mouse movement across 2 screens on a 3 screen setup. I.e. lockout only one screen.
Sadly, no. Custom lock regions is a feature I’d like to add, though.
hey man I was wondering if i could use this in shooter games and it will lock the cursor so the game doesn’t have any recoil? is that possible or no?
No, this program is not for cheating.
Hello. I have an issue with Phantom Doctrine, first I set up the program like I did with Total War Troy and it worked with that game but not with Phantom Doctrine. Can you help me?
add the correct process of game.
Hey your program works but their is kind of an issue well I’m playing windowed mode and it locks but the lock is so close to the edge of program that it allows for stretching of the game if I’m aggressively clicking, So is their a way to minimize the lock just a little bit for the left, right, and bottom borders so it doesn’t stretch the screen while playing?
Make sure the lock region is set to “Window Interior”.