Jump to content

Lock mouse to a window


Recommended Posts

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.

Link to comment
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]

Link to comment
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.

Link to comment
Share on other sites

  • 3 months later...

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
Link to comment
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.

Link to comment
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:

Link to comment
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.

Link to comment
Share on other sites

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
Link to comment
Share on other sites

  • 11 years later...
  • Developers
14 hours ago, lolau3 said:

you can death loop already. youre silly.

This us the best you can do after signing up, using a 11 years old thread to post a bullshit reply ?

*CLICK*

 

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Jos locked this topic
Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...