The way to detect the current mouse cursor type from bash or python

Viewed 2746

I know that I can get the current location of the mouse cursor by executing "xdotool getmouselocation".

I would like to detect the current mouse cursor type such as pointer, beam, or hand cursor from bash terminal or python code. Would this be possible?

Thank you. June

2 Answers
import win32gui    
win32gui.GetCursorInfo()

Will return something like

(1, 65539, (1920, 1080))

2nd number is ID of cursor type

On Windows 10 I get:

  • 65539 - normal

  • 65567 - pointer

  • 65541 - insert

Related