Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


Photo

Get Cursor Position


  • Please log in to reply
2 replies to this topic

#1 leuce

leuce

    Universalist

  • Active Members
  • PipPipPipPipPip
  • 279 posts

Posted 24 May 2008 - 07:08 PM

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







#2 Muchuchu

Muchuchu

    Wayfarer

  • Banned (NOT IN USE)
  • 91 posts

Posted 24 May 2008 - 07:16 PM

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?

#3 Bowmore

Bowmore

    Feinschmecker

  • Active Members
  • PipPipPipPipPipPip
  • 836 posts

Posted 24 May 2008 - 07:47 PM

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, 24 May 2008 - 07:48 PM.

"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users