pythonlinuxmousemouse-cursor

How to detect the current mouse cursor type using python in linux?


What I'd like to do is find out the type of cursor (ie. pointer, normal, insert) currently active in Linux using python.

I've found one post mentioning that for windows using win32gui: The way to detect the current mouse cursor type from bash or python

win32gui is Windows-specific and this library will not work in Linux. Any other solutions?


Solution

  • Use this library PyXCursor to get the image of cursor/mouse-pointer for an arbitrary application window in Linux - in Python using ctypes