Sign in to follow this  
Followers 0
MuffettsMan

ControlClick relative position to different sized windows

2 posts in this topic

Im trying to send mouse clicks to multiple windows that aren't the same size... ie I want to be able to click in the main window probably while holding down a hotkey and have it send a ControlClick to the relative position of those coordinates in the smaller window.

I have only just started tinkering but it seems i can get the relative cords from the mouse position from window by using MouseGetPos / MouseCoordMode and then after some funky math send an estimated best guess ControlClick to the other windows....

For the life of me however i can't figure out how to calculate the closest guess for the smaller window... i mean i can divide each window into quadrants and calculate if the click is in any given area however that is hardly precise. It seems i need to take the bigger window figure out the percentage diff of the smaller window then convert the x,y downscaled by that percentage?

lol as if to make matters worse the windows aren't necessarily proportional which to me means i need to make two separate calculations one for the x range based of the difference in the percentage of the windows then a second one for the y range?

any math gurus out there? :)


Don't let that status fool you, I am no advanced memeber!

Share this post


Link to post
Share on other sites



if i think of it as numbers instead of a box is it as simple as dividing big into little then multiply by 100 = % difference.... then take that percentage and make x cord that much precentage smaller.....

then do the same for y? maybe i overcomplcated things >.<


Don't let that status fool you, I am no advanced memeber!

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