Jump to content

Recommended Posts

Posted

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?

Posted

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

Posted

_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.

  • Moderators
Posted

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)

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.

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
Posted

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...

  • Moderators
Posted

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

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.

Posted

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.

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
×
×
  • Create New...