Controlling MS Windows mouse by Native Extension

Share Button

automation-iconDoing some job for our client in Salesforce area I required to upload a lot of data. This process can be automated partially. But I can’t avoid physically-based mouse actions like clicking by specific buttons in exact order. Really I don’t know if similar software can be downloaded, but simple and own Adobe AIR app can guarantee that it will work as expected without and security issues like clicking somewhere when I don’t watch on my monitor :)

But now… I can! I have done small Adobe AIR Native Extension for Windows that can fire native mouse actions like:

1438399902_mouse1) MouseButton.LEFT_UP, MouseButton.LEFT_DOWN, MouseButton.LEFT_CLICK
2) MouseButton.RIGHT_UP, MouseButton.RIGHT_DOWN, MouseButton.RIGHT_CLICK

Sure I limited features only by my own needs.

It’s pretty easy to use:

NativeMouse.click(MouseButton.LEFT_CLICK, 960, 393);

As you can see – I sent click button event and position on the screen where it must be clicked by x and y. Please note – after event fired your mouse pointer will be moved there automatically (before click will be proceeded).

P.S. Tested on Windows XP 32 bit and Windows 7 x64 bit. If you can test on Win8/Win10 – please leave a comments if it works.

UPD 1:
- added paste feature. It force ctrl+v using your own data or that you can setup via as3:

// will emulate ctrl+v with your buffer
NativeMouse.paste();

// will copy "Hello world" to Clipboard and than emulate ctrl+v
NativeMouse.paste(“Hello world”);

UPD2:
- added setters and getters for X,Y
- added setXY method
- added appendX, appendY, appendXY

You can download it for free.

Share Button

This Post Has Been Viewed 1,066 Times

8 thoughts on “Controlling MS Windows mouse by Native Extension

      1. TheRabbit Post author

        This ANE don’t have OSX version. But I’m thinking about it…. Really MS Windows offers flexible access to own API but OSX always throwing some focuses because security violation and etc.

        Reply
  1. Pablo

    Very cool !!
    But I can’t download it because your Dropbox’s account is off:
    “This account’s links are generating too much traffic and have been temporarily disabled!”

    Can I download it some other way or maybe could you send it to me by email ?

    thanks a lot !!!

    Reply
    1. TheRabbit Post author

      Sorry, was on vacation :) Traffic is so big for this ane so dropbox was turned off it. Will send it directly right now

      Reply

Leave a Reply

Your email address will not be published.

Blue Captcha Image Refresh

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>