Control mouse with Python?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • simo

    Control mouse with Python?

    I'm looking to make an app to record my mouse movements and play them
    back.

    It will essentially be for unit testing websites, so I suppose it
    could be done using one of the wxPython MSIE ActiveX widgets, but I'd
    like it to work on other platforms and not just in web browsers.

    Anyone got any ideas for how this could be done?

    I guess if reading/writing mouse movements is difficult, I could limit
    it to clicking buttons or use a fixed screen resolution and absolute
    screen coordinates, but that will be very limiting I think.
  • Daniel Dittmar

    #2
    Re: Control mouse with Python?

    Pythons tend to eat mice so they don't make good mice shepherds.


    Comment

    • Cameron Laird

      #3
      Re: Control mouse with Python?

      In article <30260531.04063 02125.7083d33f@ posting.google. com>,
      simo <simoninusa2001 @yahoo.co.uk> wrote:[color=blue]
      >I'm looking to make an app to record my mouse movements and play them
      >back.
      >
      >It will essentially be for unit testing websites, so I suppose it
      >could be done using one of the wxPython MSIE ActiveX widgets, but I'd
      >like it to work on other platforms and not just in web browsers.
      >
      >Anyone got any ideas for how this could be done?
      >
      >I guess if reading/writing mouse movements is difficult, I could limit
      >it to clicking buttons or use a fixed screen resolution and absolute
      >screen coordinates, but that will be very limiting I think.[/color]

      Common operating systems aren't friendly to this effort.
      At the least, you'll need to define your goal quite pre-
      cisely. Do you want to construct a Python program that
      monitors the mouse movement while *other* processes are
      active? That's deeply non-portable. If it's Windows that
      motivates you, <URL: http://wiki.tcl.tk/8813 > has refer-
      ences that'll help you start on the subject of
      record/playback utilities.
      --

      Cameron Laird <claird@phaseit .net>
      Business: http://www.Phaseit.net

      Comment

      • Dennis Lee Bieber

        #4
        Re: Control mouse with Python?

        On 30 Jun 2004 22:25:56 -0700, simoninusa2001@ yahoo.co.uk (simo)
        declaimed the following in comp.lang.pytho n:
        [color=blue]
        > I'm looking to make an app to record my mouse movements and play them
        > back.
        >[/color]
        Ack! I've not seen one of those since my early Amiga days, where
        one plugged into the event stream (mouse, keyboard, floppy eject/insert,
        etc.) and treated everything as a passthrough. Also how one "played
        back" -- by injecting formatted events into the stream. Had a scriptable
        event program -- came in useful for revealing the easter eggs in the OS
        (considering one of them involved something like holding down both
        left/right shift, left/right Amiga keys, left mouse button, AND
        eject/insert a disk in DF0:)

        --[color=blue]
        > =============== =============== =============== =============== == <
        > wlfraed@ix.netc om.com | Wulfraed Dennis Lee Bieber KD6MOG <
        > wulfraed@dm.net | Bestiaria Support Staff <
        > =============== =============== =============== =============== == <
        > Home Page: <http://www.dm.net/~wulfraed/> <
        > Overflow Page: <http://wlfraed.home.ne tcom.com/> <[/color]

        Comment

        • simo

          #5
          Re: Control mouse with Python?

          "Daniel Dittmar" <daniel.dittmar @sap.com> wrote:
          [color=blue]
          > Pythons tend to eat mice so they don't make good mice shepherds.[/color]

          Very good.

          I've done some research and it looks like Jython may be a better bet....

          Comment

          Working...