Sign in to follow this  
Followers 0
FinalVersion

Lock mouse to a window

11 posts in this topic

I want to lock my mouse to StarCraft II's window, so it can't go outside the window border. When SC2 is run in window mode, and you go to move around the map, if your mouse goes outside the window, it stops.

So what would be the simplest way to keep it within the border.

Share this post


Link to post
Share on other sites



Hi. Modify this script to meet your needs.

Share this post


Link to post
Share on other sites
FinalVersion, if you need any help modifying or using that script, MouseTrap, post here and I'll do what I can do. picea892, thanks for the push.

- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites

I just tried it out by default, it locks in a pretty small region, and i've looked through the script, and can't find it setting it to a specific region.

Look up _MouseTrap in Misc.au3


[left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left]

Share this post


Link to post
Share on other sites

I just tried it out by default, it locks in a pretty small region, and i've looked through the script, and can't find it setting it to a specific region.

Move/Resize the window, hit the 'Remember' button. It has a fairly good 'memory' then, much better than mine anyway..

- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Can we have MouseTrap actually detect the presence of a window using WinExists or WinActivate then lock the user in that window?

Also, can MouseTrap or Autoit in general stop users from Cntl+Alt+Delete'ing there way outside the window?

Edited by Thudo

Share this post


Link to post
Share on other sites

Can we have MouseTrap actually detect the presence of a window using WinExists or WinActivate then lock the user in that window?

Also, can MouseTrap or Autoit in general stop users from Cntl+Alt+Delete'ing there way outside the window?

Well that would be quite silly wouldnt it, why would you want to stop someone from accessing there own computer?


AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites

Its called "our environment" where we do not have Windows authentication via AD. We're artificially creating it with an Autoit screensaver so it if a user fails to put in a correct password after the screensaver ends and the "enter password" prompt comes up the system must be locked. Thats the security requirement. :blink:

Share this post


Link to post
Share on other sites

Im no expert, but I,m sure there are ways of locking a computer other than disabling built in windows security features.

Especially when you have full adminisrtative control over it, seems like an odd way to go about such a thing.


AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

Agreed except CTRL+ALT+DELETE pretty much trumps all. Its always present to get out of a situation.

Regardless.. I'm trying to lock the mouse in the middle of the screen using the following when the "Login" box comes up:

#include <GuiConstantsEx.au3>
#include <Misc.au3>
AdlibRegister("_MouseTrapCurrent")

Func _MouseTrapCurrent()
    if winexists("Login") then
_MouseTrap(550,500,750,600)
else
_MouseTrap()
    endif
EndFunc
So the script should auto-detect the instance of a "login" box on the desktop but oddly its not. :blink: I'm sure I've over-simplified this. Edited by Thudo

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0