Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Window Spy delivering grossly wrong mouse coordinates


  • Please log in to reply
3 replies to this topic
Telepski
  • Members
  • 5 posts
  • Last active: Nov 11 2014 10:58 PM
  • Joined: 24 May 2012

Recently I got myself a new giant 4k monitor. Works like a charm, however ...

 

There are a few programs allowing only for mouse operation, no keyboard navigation possible.

 

When I wrote a new AHK script for one of these progs I used Window Spy to get the (relative) coordinates for the needed clicks.

 

Put them into my script, set mouse coordinates to relative -- but surprise, script produced absolutely BS results. Reason: The mouse coordinates given by Window Spy were wrong (too small) by a factor of about 1.5!

 

I'm running Windows 8.1 x64, size of all elements (control panel -> display) is at the third of four positions, no manual adjustments.

 

Looks like Window Spy isn't able to cope with 4K monitors -- the monitor size is shown as 2560 x 1440 when I move the cursor to the right lower corner.

 

Control panel's screen resolution shows 3840 x 2160, so does AHK obviously when I look at the above results: 3840 / 2560 = 1.5, which is exactly the factor by which AHK Window Spy reports too small.

 

If there ain't no chance to correct this within the near future it at least may serve as a conversion factor for pals running into similar issues with their brand new monitors. Of course patching of Window Spay is the preferabel solution.

 



Leef_me
  • Moderators
  • 8510 posts
  • Last active: Sep 10 2015 05:50 AM
  • Joined: 08 Apr 2009

>>Recently I got myself a new giant 4k monitor. Works like a charm, however ...

 

I started to ask "what is a "4k" but it seems I found the answer

      http://www.amazon.co...r/dp/B00DJ4BIKA

 

      "...31.5-Inch 4K UHD display (resolution: 3840x2160, 140ppi) - equaling 4X the resolution of Full HD 1080p"

 

I don't have a 4k, but the monitor I have can be adjusted for different resolutions.

   do the video drivers in you computer support sucha a large area?

   is your monitor set to this high resolution?
 

Here are a few ideas for measuring the monitor resolution

 

Look in the helpfile for the command "sysget" ther is an example that give the size information for eech monitor.

Check to see if it recognizes you montor's size correctly.

 

Also,there is a command called "mousegetpos"

The helpfile has 2 examples. if you combine the examples you get a tooltip that follows the cursor and gives the current location.

 

Use this new script by:

      minimizing all windows, clicking the 'desktop' to se that as the active window, moving the mouse to upper left and lower right

        to see what the location are.



Telepski
  • Members
  • 5 posts
  • Last active: Nov 11 2014 10:58 PM
  • Joined: 24 May 2012

Hi,

 

thanks for your fast reply. The monitor definitely is working at 3840 x 2160, even the sysget example file gives:

 

Left: 0 -- Top: 0 -- Right: 3840 -- Bottom: 2160.

 

Within AHK scripts the screen and window positions are rendered correctly given the above size.

 

Thus MouseGetPos would be a workaround to get the correct mouse positions. Or multiplying all Window Spy numerals by 1.5.

 

I just wanted to point attention to the point that the AU3_Spy.exe (that's the exact name of the executable) delivers grossly wrong positions for the latest monitors, possibly due to the fact that it doesn't retrieve the actual screen size, which could be easily done e.g. via

 

wmic path win32_videocontroller get currentHorizontalResolution,currentVerticalResolution

 

Instead it may be limited to an internal table where such big monitors simply do not exist and takes the biggest available. Just an assumption, I don't know the source code.



GeekDude
  • Spam Officer
  • 391 posts
  • Last active: Oct 05 2015 08:13 PM
  • Joined: 23 Nov 2009

Check your DPI settings. AutoHotkey tries its best to compensate, but the spy does not.

Right click on desktop, screen resolution. On that window, hit "make text and other items larger or smaller". On the new window, hit "Set custom text size (DPI)". Then, if the percentage in the dropdown on that window is not 100, this is your problem.

KIO6WEo.png

 

I'm guessing it's at or around 150%, given your "1.5x" estimate