mouse
mouse copied to clipboard
not DPI aware
Modern monitors may have a DPI much higher than 96, but unless an application tells Windows that it knows that, Windows assumes the application believes the DPI to be 96 and does some stretching . That means that you can have your resolution set to 1920x1080 and mouse.get_position() will still report the bottom right as (1535, 863).
The solution is ctypes.windll.shcore.SetProcessDpiAwareness(2). Users of this library could import ctypes and set this in the application code themselves, but it would probably be better to put it into _winmouse.py.
Thanks for the information. However this seems to be a per-process setting, and doing it in a library might have adverse effects elsewhere. Do you know of any alternatives that are not based on global flags?
I don't. Perhaps it would be sufficient to document the behavior and provide the solution for those users who care.
I'm curious if a difference in DPI is what produced issue #101
I tried, but it didn't work.