Ever play a game, like Star Wars: The Old Republic (SWTOR) on a multiple monitor setup, and accidentally click your mouse JUST past the edge of the screen by accident, causing the game to completely minimize? If you do this while playing SWTOR, it'll minimize to your taskbar, which you'll have to click on, which brings up a loading screen and then when it's done loading finally shows the game screen that you were on when you accidentally clicked off of it. This can be extremely aggravating if you're in the heat of PvP battle, or a Warzone, or maybe in a Flashpoint fighting a boss mob with friends, etc.
A friend contacted me asking if there was a way to stop this from happening, so I whipped up a quick little AutoIT script that works along side of Actual Multiple Monitors (AMM), an excellent multi-monitor software, that I've already been using for a while, and highly recommend if you run multiple monitors. Unfortunately, as of this article a key combination to be able to lock the mouse cursor within any window is available in AMM, however having it auto-detect any specific window (or game), auto-lock the mouse in that window, then stop so that it doesn't affect any other windows isn't available, and according to the friend who sent me this request, it's "only possible if you also purchase another software package" written by the same developers, as stated by a support request she sent to them.
So what this little script will do is very simple: you just use AMM as usual, and when you launch SWTOR it'll auto-detect the game running, automatically do the key combo to lock the mouse to within the SWTOR screen so you can't accidentally click outside of the game window, then exit the script. Very simple yet very convenient and effective. You'll no longer need to remember to run the key combo manually each time you start the game (usually only reminded by accidentally clicking off the screen, ).
The easiest way is to just download one of the pre-compiled game launchers (I made available both a 32-Bit version and a 64-Bit version, attached to the bottom of this article)
Drop it into the same folder as the game (launcher.exe)
Create a new shortcut to it. I've also included the regular swtor icon so that you can make the shortcut look exactly like the real one, if you choose to.
Once you have the shortcut setup you're all done. Whenever you want to play the game just use the new shortcut, there's no interface to it so it'll look exactly like it usually does when you launch the game.
I've also attached the raw script to this article so that you can edit it, or run it directly via the script if you have AutoIT3 installed.
Below is the actual source code, in case anyone is interested. You can copy/paste it directly into an AutoIT3 script as is, edit it, or use and abuse it to your hearts content. Obviously it's very easy to edit it to work the same within any other game or program.
; ================================================================================ ; ; Star Wars: The Old Republic Game Launcher + Mouse Cursor locker ; Created by: GeekDrop.com / Scott Elblein / ThE STaRDoGG CHaMPioN [GD] ; ; Requirements: ; Star Wars: The Old Republic game ; Actual Multiple Monitors - https://bit.ly/actual-multiple-monitors ; AutoIT3 (Only if you run the script version of this. If you use ; the compiled .exe you don't need AutoIT) ; ; NOTE: There is NO user Interface to this. Just use it in place of your normal ; shortcut to the game, while Actual Multiple Monitors is running. ; ; Instructions: ; Just place the compiled geekdrop-swtor-mouse-cursor-lock.exe in the same folder ; as your SWTOR's Launcher.exe and use it to always start the game instead of your ; usual shortcut. ; ; If you decide to use the script version instead, place this code in a new txt ; file, save it with a .au3 file extension in the same folder mentioned above, ; right-click on it whenever you want to launch the game, and choose Run Script ; from the menu. Of course to get that menu item you'll need AutoIT3 already ; installed and working. ; ; ================================================================================ ; Start the SWTOR Launcher, to enter credentials Run("launcher.exe") ; Wait for up to 5 minutes, looking for the swtor.exe game client to appear WinWait("[CLASS:PlayerClient]", "", 60000) ; Pause for 2 minutes, otherwise it's kind of hit or miss whether the Key Combo "takes" Sleep(120) ; Activate it just to make sure it's at the front, so the Key Combo goes to the right place WinActivate("Star Wars: The Old Republic") ; Send the Key Combo to lock the mouse cursor within the SWTOR Game window Send("^!+l") ; All done here, no need to keep the script running Exit
Enjoy!
Attachment | Size |
---|---|
geekdrop-swtor-mouse-cursor-lock.au3 | 1.76 KB |
geekdrop-swtor-mouse-cursor-lock (x64).zip | 526.48 KB |
geekdrop-swtor-mouse-cursor-lock (x32).zip | 430.6 KB |
I prefer to use the "ignore" shortcut in AMM instead of the "lock" shortcut, so that I can still move my mouse outside of the game without it minimizing my game, can this be change to do that instead?
I thought I had replied earlier to this question, but I guess I didn't?
You can very easily change it to do so, by just changing the "l" to an "i" in the script above (on the "Send..." line). That's all that's needed.
Yaaay! I think the authors learned from your technique, they added it to AMM!!
[+] New
----------------------------------------------------
Actual Multiple Monitors 4.0 (13.03.2012)
----------------------------------------------------
[+] Compatibility mode is added for the Lock Mouse and Ignore Deactivation hotkeys (try to activate it if these hotkeys do not work by default for a particular game/application).
[+] Now it's possible to activate the Lock Mouse and Ignore Deactivation features automatically at specific window's startup.
i the power of GeekDrop!!
That's awesome.
I've been developing software myself for so many years now (15 years!) that I've talked to and dealt with literally hundreds of other developers of popular software, and I've come to realize that 99% of them are usually quite friendly and more than willing to add new features if you just ask them directly or point out something to them that would enhance their software. Hopefully if the AMM dev(s) see this they'll hook me up with a free registration, since my trial period ran out! it really is a great piece of software, and the best multi-monitor software I've used, and I've tried em all.
Works perfect! I have a question, I prefer to use the "ignore" shortcut in AMM instead of the "lock" shortcut, so that I can still move my mouse outside of the game without it minimizing my game, can this be change to do that instead?