Sign in to follow this  
Followers 0
blub

same mouseclick under 3 resolutions?

6 posts in this topic

is there any possibility that a mouseclick can hit the same button in resolution like 800x600 , 1024x768 and 1280x1024?

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

is there any possibility that a mouseclick can hit the same button in resolution like 800x600 , 1024x768 and 1280x1024?

Dunno, I never tried really. Try this and see:

Opt("MouseCoordMode", 2)

Read up on this in the help menu to see how it works. I've used it for switching from full screen at 800x600 to a window that had a client size of 800x600 and it works fine. I've never tried changing the resolution though. If this doesn't work you will probably have to detect the resolution and use variables to offset accordingly.

Nomad

Edit: You can also try to use ControlClick and give the text on the control.

Edited by Nomad

Share this post


Link to post
Share on other sites

Controlclick would be better as it goes directly to the control you want it to


Who needs puzzles when we have AutoIt!!

Share this post


Link to post
Share on other sites

If the window being automated is a fixed window size for each resolution, then using

Opt('MouseCoordMode', 2)

should allow the mouse to click within the windows client area. You can set Au3Info to client mode through the menu.

If ControlIDs can be seen by Au3Info, then using ControlClick maybe a better sokution as resolution or active windows are not a concern.

:)

Share this post


Link to post
Share on other sites

Func coordinates ($x, $y, $resolution_old, $resolution_new)
$newx = Int($x / $resolution_old[0] * $resolution_new[0])
$newy = Int($y / $resolution_old[1] * $resolution_new[1])
dim $array[2]
$array[0]=$newx
$array[1]=$newy
return $array
EndFunc

should work to convert coordinates between different resolutions.

Share this post


Link to post
Share on other sites

wow thx thats nice :)

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