Mouse control with ctypes in OS X

Paul McNett p at
Mon Aug 20 19:26:36 CEST 2007

Niklas Ottosson wrote:
> I need to get hold of the mouse position and also need to be able to 
> change it. In windows I have used ctypes.windll.user32.getCursorPos() 
> and ctypes.windll.user32.setCursorPos() with great success in my program 
> but now I also need to make a Mac OS X version of the program.
> Does anyone know what the above libraries and functions are called in OS 
> X? Any help is greatly appreciated. 

All I can offer you is the knowledge that OS X will probably not let you 
set the mouse position, as it is a gross violation of the HIG (The user 
is in charge of where the mouse appears, not the application).

But, I'm sure someone will chime in on how to get the mouse position.

pkm ~

More information about the Python-list mailing list