python how to check if cursor is hidden
import win32gui # pip install win32gui
def get_cursor_flag():
#Get the cursor flag (visibility)
flag, hcursor, (x, y) = win32gui.GetCursorInfo()
return flag
def run(flags):
if flags == 0:
# Cursor currently hidden
elif flags == 1:
# Cursor currently visible
else:
# Should not happen
cursor_flag = get_cursor_flag()
run(cursor_flag)