You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ensuring consistent coordinates between listener and controller on Windows
Recent versions of Windows support running legacy applications scaled when the system scaling has been increased beyond 100%. This allows old applications to scale, albeit with a blurry look, and avoids tiny, unusable user interfaces.
This scaling is unfortunately inconsistently applied to a mouse listener and a controller: the listener will receive physical coordinates, but the controller has to work with scaled coordinates.
This can be worked around by telling Windows that your application is DPI aware. This is a process global setting, so pynput cannot do it automatically. Do enable DPI awareness, run the following code:
Hi, this is a very nice app,
This is an issue with pynput, below is an extract from https://pynput.readthedocs.io/en/latest/mouse.html, maybe have the option to turn this on;
Ensuring consistent coordinates between listener and controller on Windows
Recent versions of Windows support running legacy applications scaled when the system scaling has been increased beyond 100%. This allows old applications to scale, albeit with a blurry look, and avoids tiny, unusable user interfaces.
This scaling is unfortunately inconsistently applied to a mouse listener and a controller: the listener will receive physical coordinates, but the controller has to work with scaled coordinates.
This can be worked around by telling Windows that your application is DPI aware. This is a process global setting, so pynput cannot do it automatically. Do enable DPI awareness, run the following code:
import ctypes
PROCESS_PER_MONITOR_DPI_AWARE = 2
ctypes.windll.shcore.SetProcessDpiAwareness(PROCESS_PER_MONITOR_DPI_AWARE)
Rgs
J
The text was updated successfully, but these errors were encountered: