javas Posted June 23, 2009 Share Posted June 23, 2009 I'm trying to imitate some of the functions from AutoIt in java. Is it possible to write functions like mouseclickdrag and pixelsearch in java? I heard there was some 'robot' class in the util files in java. Any help getting me pointed in the right direction would be appreciated. Link to comment Share on other sites More sharing options...
Authenticity Posted June 23, 2009 Share Posted June 23, 2009 (edited) Maybe using one of the API keybd_event or SendInput. Once you send mouse down input you need to send mouse up input to release the button pressed. By that time you can move the mouse and it'll remain pressed until the next mouse up input is sent. This is quite how it's achieved.Edit: Moi mistake ;], it's mouse_event of course. Edited June 23, 2009 by Authenticity Link to comment Share on other sites More sharing options...
Richard Robertson Posted June 24, 2009 Share Posted June 24, 2009 It won't be easy. Java is designed for MANY environments and not all environments will support those kinds of things. The only way to do some of them is by calling dll functions which ruins the whole point of java. Why do you want to write these in java? Link to comment Share on other sites More sharing options...
javas Posted June 25, 2009 Author Share Posted June 25, 2009 Well I wanted to do it in java because I know it better than C++ but I thought that instead of writing my programs in autoit which is what Ive done for a while, they might be more efficient if I customized the functions, removed some extra parameters, and etc. Link to comment Share on other sites More sharing options...
Richard Robertson Posted June 25, 2009 Share Posted June 25, 2009 In my experience, AutoIt is significantly better than java for Windows work. Link to comment Share on other sites More sharing options...
Nutster Posted June 26, 2009 Share Posted June 26, 2009 Well I wanted to do it in java because I know it better than C++ but I thought that instead of writing my programs in autoit which is what Ive done for a while, they might be more efficient if I customized the functions, removed some extra parameters, and etc.So, you want to trade off one interpreted language (AutoIt) for another (Java). In order for Java to run in so many different environments, Java gets compiled to a byte-code that then gets interpreted on the target machine.If you know Java, learning C++ is not that difficult. C++ requires the programmer to be paying a little more attention to details than you can get away with in Java, but that gives you more control as well. Take a look at this university professor's site for an pretty thorough outline of the differences between Java and C++. Here is another site talking about the differences between C++ and Java. Learn these, download a free C++ compiler (like Microsoft's VC++2008) and experiment, reading the docs as you go. Have fun! David NuttallNuttall Computer Consulting An Aquarius born during the Age of Aquarius AutoIt allows me to re-invent the wheel so much faster. I'm off to write a wizard, a wonderful wizard of odd... Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now