Sign in to follow this  
Followers 0
Tasmania

"Springing" the mouse trap...

10 posts in this topic

I suppose if there is no function to remove mouse-trap, you can set it to the desktop dimensions, but that's an... um... improper... way of programming (at least the programming languages I come from).... but is there a way to un-set the trap? Spring it in a sense of words?

Share this post


Link to post
Share on other sites



I dont really understand what you mean by "trap". What code are you using to cause this? What are your intentions?

Share this post


Link to post
Share on other sites

_MouseTrap under Misc.au3. I'm locking the mouse coordinates to a certain part of a window based on GetWinPos and some basic math, and the lock remains throughout execution of the script.

Share this post


Link to post
Share on other sites

I suppose if there is no function to remove mouse-trap, you can set it to the desktop dimensions, but that's an... um... improper... way of programming (at least the programming languages I come from).... but is there a way to un-set the trap? Spring it in a sense of words?

The demonstration in the helpfile shows you how to "untrap" it...

_MouseTrap(coords) = Trap

_MouseTrap() = UnTrap (Notice there is nothing in the params)


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Helpfile? There's a help file for this? I have tried searching the AutoIt Help file for Mouse Trap and couldn't find anything... where is this help file?

Edit: Found it! UDF's! This should make life easier... wahoo!

Edited by Tasmania

Share this post


Link to post
Share on other sites

Just click the Header of the Window and move it, it untraps the mouse, atleast for me it does.

Yes, that's not exactly what I meant.. I've got it with _MouseTrap(), which is exactly what I wanted, however I also didn't want my users to be able to "spring" it themselves like that, so I disabled access to the header of the window via mouse :)

I'm evil...

Share this post


Link to post
Share on other sites

Yes, that's not exactly what I meant.. I've got it with _MouseTrap(), which is exactly what I wanted, however I also didn't want my users to be able to "spring" it themselves like that, so I disabled access to the header of the window via mouse ;)

I'm evil...

lol, you are :)


[font="Georgia"]Chances are, I'm wrong.[/font]HotKey trouble?Stringregexp GuideAutoIT Current Version

Share this post


Link to post
Share on other sites

Just FYI, ctrl+alt+delete is going to "untrap" it as well.


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Hehe yeah, that I hope for. Actually, any command that takes focus away from the window "untraps" it, oddly enough, but I suppose that's inevitable. I could make sure it has focus and put a while in like so:

While WinNotActive("Notes")
  WinActivate("Notes")
WEnd

But that's just... so... so mean... and really, the people who will be running it won't have that much knowledge in computers anyway... hehe, so it's kinda unneccessary.

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