I am a complete beginner to Python so dont understand the lingo. I want to use python to do a simple click at a specific point. I have already managed a left click using ctypes:
>>> import ctypes
>>> ctypes.windll.user32.SetCursorPos(x,y), ctypes.windll.user32.mouse_event(2,0,0,0,0), ctypes.windll.user32.mouse_event(4,0,0,0,0)
is there a way to do a right click in the same way?
Here are the constants that you would use for
mouse_eventIn your code you are sending two events:
MOUSE_LEFTDOWNandMOUSE_LEFTUP. That simulates a “click”.Now for a right click you would send
MOUSE_RIGHTDOWNandMOUSE_RIGHTUPin a similar fashion.