5

I am creating a robot using java, but there is an application which has an special and strong security and I cannot execute my robot over there, for some reason that I don't know, my robot cannot change the mouse position when such application is running. I am using the java.awt.Robot class to change the mouse position, but it doesn't work, so I would like to know if is there another way to change the mouse position with java, I was thinking in try to change the mouse buffer with java (maybe it is not possible, is it?). I appreciate if you could tell me some way to change the mouse position with java without using the java.awt.Robot class.

For example this code chage the mouse position to the 500, 500 coordinates:

Robot robot = new Robot();
robot.mouseMove(500, 500);

, but it doesnt work while the application with the special security is running.

Thank you.

kleopatra
  • 51,061
  • 28
  • 99
  • 211
  • 1
    There is no such mechanism unless you use JNI. – bmargulies Oct 01 '12 at 14:33
  • It could be that being able to change the mouse pointer position is considered a security flaw. So imho you need to get hold of the requirements specifying that, so you either have a good reason (that is: a new, currently unknown requirement) to set the mouse pointer pos, defeating the existing requirement, or, even better, you have a proof for you being supposed to be unable to set the pos, so you can stop the whole activity altogether. Don´t try to break requirements! Get them documented, or defeated officially. Then, the technical solution will be much, much easier, if required at all. – TheBlastOne Oct 08 '12 at 09:51

1 Answers1

0

win7 or xp? If win7, try run as administrator.

wangxt
  • 77
  • 7