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
Errmahgerd, you are a life saver! I always wanted to play Fallout: New Vegas, but with the mouse cursor always moving out of the edges and minimizing the game, it drove me nuts. Your app fixed this, so that I can finally enjoy the game! Thanks a bunch!
Cool story. Didn’t know New Vegas had problems, but glad I could help anyways.
Exactly the same thing Drakhor, thank you Snake for creating this program and gifting it unto the internet. I donated and would have paid money for this
Your gratitude is appreciated.
Thanks. This was working great on my old PC for a number of games. Moved onto a new PC now (still Win 7 64 bit) and cannot get the cursor to lock on Assassins Creed 2 (running via steam and uplay)
Created shortcut has the following as its target:
“E:\Programs\Cursor Lock\CursorLock.exe” /O:”C:\Program Files (x86)\Steam\Steam.exe” /P:”-applaunch 33230″ /A:”M:\Steam\steamapps\common\Assassin’s Creed 2\AssassinsCreedIIGame.exe”
cursor lock shortcut looks right, assuming AssassinsCreedIIGame.exe is the correct executable. you might try user mode and see if you still can’t get Cursor Lock to work. if it does work, then you need to look at your shortcut settings again.
With the Assassin’s Creed 2 game, it goes through Uplay browser, as well as steam. I tried using it with the steam -applaunch 33230, and it launches the game, but it wont lock. But using user mode and creating a shortcut works. Thanks man.
Does not work on my windows 8 x64
i can’t confirm or deny this yet as I don’t have that platform to test on, but thanks for the report. sorry you’re having trouble.
There seems to be something wrong with the download. A whole bunch of errors come up
thanks for the report! it should be fixed now.
Please i need a way to freeze the cursor in SILENT HILL 2!!!!
You.
Are.
Awesome.
It even works for windowed mode on Steam Games, like TF2, thanks! :’D
Can you please tell me what you put in open program and lock program?
RTFM, please.
Hey, I’m having a bit of a problem with cursor lock. I doesn’t lock anything and not even when it’s on self test. After installing it says that it hasn’t been installed properly, I’ve tried version 2.5.2 and version 2.5.1. And I wouldn’t normally bother with this but I can’t find anything on the net.
Have a nice Day.
i’ll need to know more about your setup. mainly what operating system, where you’re installing to, if you’re installing as administrator, other programs running, etc. this is the first time i’ve heard of this problem.
Yeah, sure.
I’m installing into Program Files (x86), I’m installing as administrator and the operating system is Windows 7 Ultimate (64 bit). When I’m using it there is Chrome Open and the game I want to use which is the most recent ghostbusters game in windowed mode.
But it Cursor Lock doesn’t work on itself so I’m going to reset and check the hard disk permissions.
Do you think that there may be a problem about language? My operating system is in spanish, but I’m not sure if that may have something to do with anything.
make sure the installation directory contains CursorLock.exe and you can run it (i.e. have permission). you might also enable logging and see if that reveals any errors. or try running using command line–see the documentation.
Does this work with Diablo 3? Trying to play in windowed mode/full screen windowed mode neither options are working for me.
I just created a shortcut based on the D3 executable from the “open program” option.
Also tried “lock region” screen and interior.
I just tried using Cursor Lock with windowed Diablo 3, and (as with all things) it works fine. Here are the settings it needs:
Open Program: Diablo III Launcher.exe
Lock Program: Diablo III.exe
Lock Region: Window Interior
Force Lock
thanks, I was missing the whole “lock program” step. Thought just checking the executable in “Open Program” locked it by default. Appreciate the quick response and thank you for this app!
Love the program, thank you so much.
Have a suggestion tho, is it possible to have it monitor specific processes and have it lock the cursor when those processes are present and unlock when aren’t?
Nope, sorry. If you don’t want to bother with creating shortcuts for every program, use manual mode.
Can only recommend this solution. It’s very comfortable.
I just launch Cursor Lock in Strick User Mode and leave the app running all the time. It use only 780k memory for me.
I then toggle it on/off at my leisure with ctrl+alt+,
You can also setup hotkeys to close the program or cycle through different lock modes like screen/display, window inside borders, window outside borders.
It’s really great with apps and games using fullscreen window border mode less like Fallen Enchantress, Star Wars The Old Republic or just Civilization 5.
That way you can quickly toggle the lock off, do stuff on your second display, then go back and resume what ever you where doing before.
How do you get steam games to work when they only show 4 digits on the steam store? (painkiller black edition in this case) cause i did everything shown in the video using the 4 digits and it simply loads the steam store. i appreciate any help you can give thanks
Solved it myself, the way of finding your games ID is now incorrect as it gave me a 4digit ID that just sent me to the store, doing what this website said gave me the correct App ID: https://support.steampowered.com/kb_article.php?ref=3729-WFJZ-4175 putting the ID i got using this method in worked perfectly, you may need to update your video to make sure everybody can run their games thanks also consider this confirmation that painkiller black edition is fixed using cursor lock on win 7 64 bit professional. thanks for making this program
thanks for the report. unfortunately, i couldn’t confirm this behavior. but i’ll keep an eye on it.
certainly, we can expect that any given method for finding the steam id may become obsolete within a few years.
Can you no go and target the game .exe file directly in you installation folder like,
..\Steam\steamapps\common\painkiller black edition\Bin\Painkiller.exe
Maybe I just got the question wrong. In that case sorry for the confusion.
This is a really great program, really helping me a lot.
But 1 thing that I really hope is that I can toggle cursor lock using middle click button.
It would be really nice if there is an option that we can control cursor lock toggle from mouse(middle click button).
Thx
Is there any way that I can add manually middle click as toggle button in the cursorlock.ini configuration file?
What should I write here?
ToggleLockText= [?]
Many thx.
Yes, you should be able to use the middle mouse button to toggle Cursor Lock. And yes, it will require editing the config manually. Under [Hotkeys], you want to change ToggleLockKey=4. This is the virtual key code for middle mouse. Haven’t actually tried it, though, but it should work. Let me know.
Unfortunately it is not working. tried the value 4(middle click) also tried value 2(right click).
Are you using somekind of mouse software? You could maybe create a macro and bind it to your middle mouse.
How do you find app ID for Origin games??
Trying to fix Dead Space cursor problem that happens when you launch the game through Origin.
Under Open Program I selected Origin.exe and for Lock Program I used Dead Space.exe but since I don’t know how to find the application ID I left it blank and made the shortcut. The shortcut launches Origin but it does not launch the game… If then launch the game from the Origin play Icon I still have two cursors… Please help.
Is there a mailing list or RSS feed I can subscribe, so I don’t the release of a new version? Also if you add an installer can still offer a stand alone version. This tool is very handy for me as a portable app.
…so I don’t MISS the release of a new version?
well, it already has an installer but is still very portable. you can copy an installation from one computer to the next.
might be some time until i get a new version done, but any news on that will be on my blog. you can subscribe to this feed: http://www.snakebytestudios.com/tag/cursor-lock/feed/
Oh , must just have forgotten its has an installer too.
Sometimes I test if I can run an useful program from any location, and then dump it into my tools folder, which I sync with all my portable devices.
Thanks for the feed link.
Hey there!
Cursor lock has been working great for me but i recently had to re-make the shortcut for my cursor locked TF2. I had forgotten what i did previously so i had to do some research (googling) and when i tested it out, it worked on first launch but whenever i tried to move the window or ALT-tabbed out of the window, cursor lock would stop functioning. The settings i am using are as follows:
Open Program: C:\Program Files\Steam\Steam.exe
Args: -applaunch 440 -novid -useforcedmparms -noforcemaccel -noforcemspd -sw -w 1050 -h 788 (-applaunch is the only relevant one i assume)
Lock program: C:\Program Files\Steam\steamapps\shrover\team fortress 2\hl2.exe
Is there anything that I should be doing or that I am doing wrong?
settings look good to me. you might try checking “Force Lock” as well, although it should be enabled by default. or setup a hotkey to toggle the lock and you can use that just in case it gets unlocked when you’re moving the window around.
I have CursorLock, but when I try and play Dark Souls with it, the cursor is still there, and I only have a single screen. And I’ve done everything by the tutorial you’ve set up, and it still doesn’t work, well, it works when I don’t move the mouse, but I use the mouse and keyboard, and I’d like to know HOW I can get this to work right.
if you’re only using one monitor and not windowed mode, you don’t need Cursor Lock. I hear people are using a program called DSfix to hide the mouse cursor in Dark Souls.
Hi!
When I installed Cursor Lock something went wrong. The program keeps sayin’ “Help me.
I broke apart my insides.”. I thought a uninstall/reinstall would do the trick …but there’s no way to uninstall it. Can’t even find Cursor Lock in the Control Panel.
I’ve tried locating the files manually, deleting ’em and re-install the Cursor Lock. Yet it still says “Help me I broke apart my insides” and keeps saying that I should re-install it.
lol. it’s an easter egg. no need for alarm.
Nine Inch Nails – Closer lyrics
How do you unistall Cursor lock? It’s not listed in the programs to uninstall.
There is no uninstaller because Cursor Lock doesn’t molest your system like many other programs do. Just delete it from the hard drive and start menu. It installs defaultly to “C:\Program Files\Cursor Lock” on XP and “C:\Program Files(x86)\Cursor Lock” on Vista/7.
I’m looking into adding an Uninstaller for the next version, though.
Also, try this.
Just wanted to let you all know that I have started working on a new version of Cursor Lock. If you’re interested in beta testing, leave a reply.
Would be very interested In beta testing
Hi. Thanks so much for the tutorial. I have a problem, when i click “create shortcut” pops a window that says i don’t have permission to modify files. i’ve tried everything (my user is the administrator and owner already) and still happens. Anyone has the same issue? Is it just in Windows7?
Thanks again.
As I explained in a comment on a related blog post, this is a compatibility problem with Windows 7 and .Net 1.1. It has been suggested that you can save the shortcut to a location like My Documents to get around this. I’ll try to fix it soon, but it will require me to convert the project to a newer version of .Net, which might get messy.
Thanks for the report.
Yes, i actually found that later. Sorry for double asking. Thank you so much for your help. You’ve returned the joy of playing Fallout 3, Left 4 Dead 2, and many other games that, for some reason, kept closing or minimizing even if i played them on full screen.
Just wanted to thank you for this nifty tool
I play Team Fortress 2 in a window and i often get problems when i move the mouse too fast it then exits the window, if i click then TF2 gets minimized. i used your program, and when i opened the shortcut i made, it opened the correct program, so i know i did that right, but it still doesnt lock the cursor into the window. does having no border affect this?
i don’t have TF2, so I can’t tell you exactly what’s wrong. but it sounds like it may be using a launcher. see my reply to anon for how to figure that out. and make sure you have the lock region set to “window interior”.
im trying to get it to work for age of empires online but there are 2 launchers 1 from steam and the 2nd from aoe i have no idea which file the 2nd actually launches but the cursor lock only works untill the actual game itself opens then its gone =.=
have task manager open so you can see what the name of the executable is when you’re playing the game, and then set that executable as the “lock program” parameter. if you still can figure it out, use “user mode” and just turn the cursor lock on and off with hotkeys.
BTW, thanks for letting me know about AOE online. i might be interested in that after i’m done with diablo 3. 😉
A follow reply to this – When using AOE online specifically I am having an issue where no matter which (user mode or program), when activating the lock I am actually being locked out of the game. The edge panning doesn’t let my mouse pass into the game from my desktop.
It’s a bit awkward but strict user mode lets me get around this.
not sure what you mean by “being locked out of the game”. Cursor Lock is never going to let your mouse pass from the desktop into a game unless you toggle the lock off first. you might check to make sure that the force lock option is on.
Hi, I’m currently experiencing a small issue. I’ve been trying to stream some Command and Conquer 3 Kane’s Wrath to my friends and the streaming software doesn’t work in fullscreen mode. I’ve managed to set it to window mode but now my mouse scrolling is disabled, preventing me from viewing anything with my mouse. I’ve come to the conclusion that this is most likely because the mouse isn’t locked to the window, and this led me to your app, even though I don’t use a multimonitor setup. Now my problem is that CNC3 KW uses a launcher executable however the actual program itself isn’t an executable, but a .dat file being run by the launcher, making it impossible to select from the cursor lock window.
Would it be possible for you to add some sort of task selection so I could select which window to lock the mouse to from my task manager list or support for this particular issue?
That is an interesting problem. However, you should be able to edit the shortcut manually to change the /L argument to point to your .dat executable. And actually, you could probably also edit the Lock Program field directly in the setup app–you don’t have to rely on the file browser dialog.
A follow-up on my previous issue, this time extended to Tiberian Twilight. Both games use the same engine apparently, and the only way to make them play in window mode is to add the “-win” argument to a shortcut. Now, because EA in general sucks, I have to deal with the same issue of the mouse refusing to scroll in window mode. Now maybe I’m not doing this right or going about it the wrong way, hell, it might not even be a locking issue as far as I know, but I gave up back then trying with Kane’s Wrath before I read your reply. This time the filetype used by the CNC4 launcher is a “.game” one although I’m almost completely sure it’s just some weird archive type. Anyway I tried your suggestion by editing the “lock program” field manually to simply point to the “.game” file but that didn’t work, or it simply didn’t enable mouse scrolling while in window mode. Next I tried strict user mode with various hotkey combinations and still scrolling would not work. Now I’m not even sure if Cursor Lock achieved the locking or not, or if it did, it didn’t have any effect on my issue. Help a nab out. :>
the only thing i can think of now is make sure you have the lock region set to window interior. i don’t have any of those games, so i can’t help you out further. sorry.
I managed to achieve the lock inside the CNC4 window using the window interior option but unfortunately that still didn’t fix the scrolling issue. Ah well, thanks anyway. 😀
Hi
Very very cool tool!
But I cant find the possibility, start CursorLock with the system boot in “unlock” mode and first /as needed/ locking the screens.
It start always with lock-mode and not with unlock-mode
Yeh, Cursor Lock always starts locked in either of the user modes. That’s a good idea, though. I’ll keep it in mind. Thanks.
I’m using the program for years now, was time to say thank you.
So, THANK YOU. Cursor Lock is an App I would take with me on a deserted island. Well if the island had power and I also would take two displays with me. 😉
lol. thanks, guy.