Sign in to follow this  
Followers 0
youknowwho4eva

Detecting Mouse Cursor Changes

7 posts in this topic

I'm wondering, is there a way to detect when the mouse changes to a certain cursor to do something. For example, in my CAD software when you go over the Model Space the cursor becomes Cross Hairs. I want it to perform an action when and only when the cursor changes to the Cross hairs.


Giggity

Share this post


Link to post
Share on other sites



Take a look at MouseGetCursor() in the help file.

While 1
$foo = MouseGetCursor()
Select
Case $foo = 3; Crosshairs
; Perform desired action
ExitLoop
Case Else
; error handling
EndSelect
Sleep(5); reduce cpu load
WEnd

Share this post


Link to post
Share on other sites

ah thank you, I tried looking up somethings but didn't get the results I was looking for (probably more likely that i didnt understand that it was what I was looking for) I had to change it to 0, I'm guessing because its a app specific cross hair. now I need it to move attention to where the mouse is, without clicking. Is that possible?


Giggity

Share this post


Link to post
Share on other sites

Be aware that MouseGetCursor() = 0 is unknown so you may trigger the action even if the cursor is not a crosshair.

now I need it to move attention to where the mouse is, without clicking.

You can get the x,y coords of the mouse if that's what you mean. See MouseGetPos() in the Help file.

Share this post


Link to post
Share on other sites

Yes, I understand that, but I don't see another on the list that would work. and I don't want the cordinants of the mouse, In the CAD program every button on the mouse has a set task, but the only way to bring attention to model space is to click in the model space, which will activate the assigned task (dont want to do that). I didn't know if there was a way for autoit to activate the model space when it saw the cross hairs without actually clicking in the model space.


Giggity

Share this post


Link to post
Share on other sites

I do not believe AutoIT can do that natively however you could use AutoIT and COM to activate the model space.

Share this post


Link to post
Share on other sites

I'm thinking if I set it to send say ctrl rightclick, that it will activate it and not perform a task, unless someone out there has a task set to ctrl rightclick. (I know I don't, but others like to have their mouse set to do everything)


Giggity

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