Trap a mouse click

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
IRedsell
Newbie
Posts: 7
Joined: Mon Nov 13, 2006 5:53 pm

Trap a mouse click

Post by IRedsell » Mon Nov 13, 2006 5:57 pm

I am writing a macro that is working with Autocad as those who are familiar with it there is a challenge in working within 2 windows. I want to be able to recognise when the user clicks their mouse, I have tried working around this using the new image collection tool, but this take a long time and the macro sometimes times out. Is there any wait click functionality I could monitor?

Thanks in anticipation

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Mon Nov 13, 2006 6:07 pm

WaitKeyDown - also detects mouse clicks. E.g.:

WaitKeyDown>VK1

Waits for left mouse click.

Or use OnEvent with an KEY_DOWN event handler.

Mouse VK codes:

VK_LBUTTON (1)
Left mouse button

VK_RBUTTON (2)
Right mouse button

VK_CANCEL (3)
Control-break processing
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

IRedsell
Newbie
Posts: 7
Joined: Mon Nov 13, 2006 5:53 pm

Thanks

Post by IRedsell » Mon Nov 13, 2006 6:11 pm

Marcus Thanks, I have just read through the web and discovered your answer, thanks for the fast feedback and the incredibly powerful tool. Its a joy to work with..... :P

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts