system.mouseX on retina displays

What are you measuring that gives you 1.715 ?
Apples uses even scales (1, 2, 3 etc)

Norman,

The display has a reported pixel resolution of 2880 x 1800. But the mouseX and Y values go to 1680 x 1049 when I am using the “default for display” option in the Displays window of system preferences. I am using a macbook Pro 15 inch 2016 and running Sierra. I can get the full resolution by selecting Scaled in the Displays window and selecting More Space. Then system.mouseX/Y give exactly the right numbers based on the pixel resolution. I agree- this is strange behavior, and it does not happen on my Mac Pro, which has a separate display.

Clearly Apple is not using even scales on my macbook pro, or, there is something wrong with system.mouseX and system.mouseY for my configuration.

ah using scaled yeah you would get screwy results as they map logical “points” into real pixels

1/1.715 = 0.583 or 58.3% I mentioned earlier

Speak for yourself!

I have my Late 2013 27" iMac set at 1280 X 720 (retina emulation on a non retina screen). I would rather not have to use reading glasses while coding… getting old is a pain!

BTW I do have a 2nd monitor to have more screen real-estate.

  • Karen

I was talking about average people with a normal eyesight, or glasses. I code all day long with presbicia and glasses, on a 21.5 iMac 1980 x 1080 screen. You should get a 38". It would certainly be even more comfortable :wink:

[quote=329219:@Michel Bujardet]
Try to use ScaleX and ScaleY to make the pixels coordinate equal to the values in MouseX and MouseY.

g.ScaleX = 2880/1680 g.ScaleY = 1800/1049

That way you can work in points rather than pixels, like you do on a non Retina display.

https://developer.apple.com/library/content/documentation/2DDrawing/Conceptual/DrawingPrintingiOS/GraphicsDrawingOverview/GraphicsDrawingOverview.html[/quote]

Sorry to hijack a 3-week-old thread, but I’m experiencing a similar problem tracking mouse coordinates vs screen resolution and it’s further complicated that I’m trying to track the mouse coordinates across three monitors that have different dpi’s. Is there a way to get the scale factor per-monitor to take this into account? Need it to work cross-platform.

Maybe one of these two
https://msdn.microsoft.com/en-us/library/windows/desktop/dn280510(v=vs.85).aspx
https://msdn.microsoft.com/en-us/library/windows/desktop/dn302060(v=vs.85).aspx