Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #38383

Moving mouse, Python3 and PyObjc

Newsgroups comp.lang.python
Date 2013-02-07 15:22 -0800
Message-ID <da8d9786-1e39-44c0-80af-14dab2327074@googlegroups.com> (permalink)
Subject Moving mouse, Python3 and PyObjc
From joaofguiomar@gmail.com

Show all headers | View raw


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.

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Moving mouse, Python3 and PyObjc joaofguiomar@gmail.com - 2013-02-07 15:22 -0800
  Re: Moving mouse, Python3 and PyObjc Terry Reedy <tjreedy@udel.edu> - 2013-02-07 19:51 -0500
  Re: Moving mouse, Python3 and PyObjc Dave Angel <davea@davea.name> - 2013-02-07 21:08 -0500
    Re: Moving mouse, Python3 and PyObjc Oneill <joaofguiomar@gmail.com> - 2013-02-08 02:32 -0800
      Re: Moving mouse, Python3 and PyObjc Dave Angel <davea@davea.name> - 2013-02-08 09:36 -0500
    Re: Moving mouse, Python3 and PyObjc Oneill <joaofguiomar@gmail.com> - 2013-02-08 02:32 -0800
  Re: Moving mouse, Python3 and PyObjc Oneill <joaofguiomar@gmail.com> - 2013-02-08 02:24 -0800

csiph-web