Skip to content Skip to sidebar Skip to footer

Kivy Capture Mouse Coordinates Outside Of Window

How can I capture the mouse coordinates using Kivy when the mouse ventures outside the Window bounding box? I am creating a Desktop application.

Solution 1:

Use from kivy.utils import platform to get the platform the app is being run on. Then, for windows:

flags, hcursor, (x,y) = win32gui.GetCursorInfo()

for Linux distros, use:

from Xlib import display
data = display.Display().screen().root.query_pointer()._data
data["root_x"], data["root_y"]

Post a Comment for "Kivy Capture Mouse Coordinates Outside Of Window"