Sign in to follow this  
Followers 0

Get Cursor Position

3 posts in this topic

Posted

G'day everyone

I'm running AutoIt scripts on a program that has an edit pane but no helpful control names etc. The program is OmegaT, by the way. I need to click with my mouse in a certain place, but the only way I can reference that place, is to say that it is 10 pixels above the cursor position. I mean, the exit box has a blinking cursor in it, and I need to find the pixel position of that cursor. As mentioned, the edit pane itself doesn't have a control name (the app OmegaT is written in Java, see).

Any ideas about how to get the cursor position? I was hoping for something along the lines of MouseGetPos, but if it aint that simple, I can improvise.

Thanks!

Samuel

Share this post


Link to post
Share on other sites



Posted

Lol I can across this problem a while ago if I am understanding it correctly.

$arr1 = mousegetpos()
mouseclick($arr1[0],$arr2[1] + 10)

Like that?

Share this post


Link to post
Share on other sites

Posted (edited)

G'day everyone

I'm running AutoIt scripts on a program that has an edit pane but no helpful control names etc. The program is OmegaT, by the way. I need to click with my mouse in a certain place, but the only way I can reference that place, is to say that it is 10 pixels above the cursor position. I mean, the exit box has a blinking cursor in it, and I need to find the pixel position of that cursor. As mentioned, the edit pane itself doesn't have a control name (the app OmegaT is written in Java, see).

Any ideas about how to get the cursor position? I was hoping for something along the lines of MouseGetPos, but if it aint that simple, I can improvise.

Thanks!

Samuel

WinGetCaretPos ( ) should report the coordinates of the blinking caret. However the hepl file says some applications may not report the correct value, so I guess you will just have to try it to see if it works.

Edited by Bowmore

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