I am using Fedora 40 spin KDE Plasma. As stated, mouse position reporting breaks if the mouse is not over any of the windows created by Python. To reproduce:
- Run
sudo idle3
(must have IDLE installed)
- Enter the following live code:
import mouse
import time
while True:
print(mouse.get_position())
time.sleep(0.5)
- Move the mouse around.
The printed position will only update while the mouse is over the IDLE window.
If you run the same code in Python via the terminal, the mouse position does not update at all, presumably because the terminal window was not created by Python.