Sign in to follow this  
Followers 0
DoubleMcLovin

Request mouse position...

9 posts in this topic

Hi everyone, it has been a few years since I have played with autoIT and I wanted to start with a simple script that will make a dialog box asking you to click in a certain area (in a different window) and upon click, it will record the location to a variable and then close the dialog box. I can't find a good tutorial on how to do this, however, so I thought it was worth a shot to ask for some help! Thanks in advance.

Share this post


Link to post
Share on other sites



You mean you actually looked for information in the Helpfile and Forum to see if there was information available?

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Yes that is absolutely what I am saying, and I also did a fair amount of searching through google.

Share this post


Link to post
Share on other sites

I'm curious. What did you try searching for?

Share this post


Link to post
Share on other sites

find mouse click, find mouse location, get mouse location, mouse location, get mouse position onclick. Things like that. Most everything pointed me towards the autoit spy (autoitinfo.exe) which is great, but does not accomplish what I need done. If I missed something obvious someone please point it out.

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Yes, it's harder to find if you don't know the correct term. It's not impossible though. Here is a search for mouse hook.

Edit: lol sorry.

Edited by Authenticity

Share this post


Link to post
Share on other sites

TY very much ;) I knew there would be a way to do this but for the life of me I couldn't find anything in the list of functions @_@

Share this post


Link to post
Share on other sites

>_> after a lot of reading through those I got rather confused. Can someone help em out here? I just need like a tooltip to pop up on the mouse saying "click the tree" then save the tree's x,y coords in a var then say "the tree is at $loc[1] $loc[2]"

Share this post


Link to post
Share on other sites

If you don't want to use hook. You can let the user press your GUI and without releasing the mouse button move the cursor to the tree and release the mouse button there. This way you'll receive a $WM_LBUTTONUP message, then use MouseGetPos or something. This approach is like the Finder Tool of AutoIt Window Info tool. Another way would be to use a hot-key. If you're insisting to perform it via a mouse click, I guess that your easy solution would be to use mouse hook.

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