Moving mouse, Python3 and PyObjc

Oneill joaofguiomar at gmail.com
Fri Feb 8 05:24:35 EST 2013


On Thursday, 7 February 2013 23:22:01 UTC, Oneill  wrote:
> import objc
> 
> 
> 
> def clickMouse(x, y, button):
> 
>     bndl = objc.loadBundle('CoreGraphics', globals(), '/System/Library/Frameworks/ApplicationServices.framework')
> 
>     objc.loadBundleFunctions(bndl, globals(), [('CGPostMouseEvent', 'v{CGPoint=ff}III')])
> 
>     CGPostMouseEvent((x, y), 1, button, 1)
> 
>     CGPostMouseEvent((x, y), 1, button, 0)
> 
>  
> 
> clickMouse(600,500, 1)  
> 
> 
> 
> 
> 
> this seems to send the mouse cursos to the top left corner, no matter what coords i send on clickMouse...
> 
> 
> 
> 
> 
> Also, I just can't seem to install PyObjc and use it on Python3.3 ... always get No module named objc.
> 
> 
> 
> Sighs... Made a simple python app while at work (windows 7) and was trying to change it to work on Os X (home computer) but cant even get the basics done (move and click mouse)....
> 
> 
> 
> 
> 
> Thank you.




Well i did this : sudo env CC=clang easy_install -U pyobjc

and i get alot of these: 

warning: no directories found matching 'source-deps'
warning: no previously-included files matching '.DS_Store' found anywhere in distribution
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files matching '*.so' found anywhere in distribution
clang: warning: argument unused during compilation: '-mno-fused-madd'
Skipping installation of build/bdist.macosx-10.8-intel/egg/PyObjCTest/__init__.py (namespace package)
Skipping installation of build/bdist.macosx-10.8-intel/egg/PyObjCTest/test_abactions.py (namespace package)

before i tried easy_install pyobjc and it failed, with  env CC=clang it finishes but with alot of those warnings.





More information about the Python-list mailing list