Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder7.xlned.com!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'skip:[ 20': 0.03; 'mouse': 0.07; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:Python3': 0.09; 'terry': 0.09; 'def': 0.10; 'globals(),': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reedy': 0.16; 'wrote:': 0.17; 'jan': 0.18; 'module': 0.19; 'import': 0.21; 'button,': 0.22; 'work.': 0.23; 'seems': 0.23; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'header:X-Complaints-To:1': 0.28; 'post': 0.28; "skip:' 50": 0.29; 'install': 0.29; "skip:' 20": 0.32; 'to:addr:python-list': 0.33; "can't": 0.34; 'done': 0.34; 'fail': 0.35; 'pm,': 0.35; 'received:org': 0.36; 'but': 0.36; 'should': 0.36; 'does': 0.37; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'matter': 0.61; 'subject:, ': 0.61; 'email addr:gmail.com': 0.63; 'more': 0.63; 'received:fios.verizon.net': 0.84; 'subject:Moving': 0.84; 'cursos': 0.91 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Terry Reedy Subject: Re: Moving mouse, Python3 and PyObjc Date: Thu, 07 Feb 2013 19:51:14 -0500 References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: pool-173-75-251-66.phlapa.fios.verizon.net User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Thunderbird/17.0 In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 28 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1360284710 news.xs4all.nl 6896 [2001:888:2000:d::a6]:60927 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:38388 On 2/7/2013 6:22 PM, joaofguiomar@gmail.com 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. If the import fails, then the call to clickMouse should fail with NameError, but you said that clickMouse executes, so it is hard to determine what you have done and what does and does not work. You need to post more information. -- Terry Jan Reedy