Results 1 to 5 of 5

Thread: Controlling the mouse from a programme

  1. #1
    Join Date
    Jan 2009
    Beans
    104
    Distro
    Ubuntu 11.04 Natty Narwhal

    Red face Controlling the mouse from a programme

    I want to create a programme that interacts with another programme by controlling the mouse pointer. Moving it about, clicking or holding buttons, and so on.

    I've spent some time googling, but it's hard to come up with good results, since I'm not really sure what I'm after. The closest I've found so far is when searching for "mouse emulation", but that was more about recording and replaying actions which isn't what I want.

    I need to have pixel perfect control over the mouse.

    Does anyone have any suggestions about what would work? Or any pointers about what I should be googling? I'm lost

    Any help would be appreciated

  2. #2
    Join Date
    Jun 2008
    Beans
    204
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Controlling the mouse from a programme

    I have never really tried anything like this...

    Python - in particular "Pygame" can work on a pixel-by-pixel basis (of course, game programming is closely tied into controls/the mouse cursor). If I were in your position, but had my own very limited knowledge, I would try pygame first and see what is available.

  3. #3
    Join Date
    Nov 2005
    Location
    Netherlands
    Beans
    88
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Controlling the mouse from a programme

    Take a look at wmctrl and devilspie, those 2 apps should be able to accomplish what you want.
    Pwn the day

  4. #4
    Join Date
    Jan 2009
    Beans
    104
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Controlling the mouse from a programme

    Quote Originally Posted by Jeroensum View Post
    Take a look at wmctrl and devilspie, those 2 apps should be able to accomplish what you want.
    Thank you Jeroensum and lordhaworth! I know what I was asking was unusual, so thanks for posting!!!

    In the end I found what I needed. A nice little programme called "xdotool" looks like it'll do 100% what I need.

    It was actually Jeroensum's suggestions that started me indirectly on the trail to what I needed. So double thanks to you! I've spent almost three hours today trying to find what I wanted, I was beginning to think it didn't exist.

  5. #5
    Join Date
    Jun 2008
    Beans
    204
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Controlling the mouse from a programme

    No problem, shame I couldn't be more help - but I am no expert on this kind of coding. Cheers for posting your findings, I would be interested in taking a look myself... I will be of more use next time someone posts a similar question!

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •