Robot event and function event
in
Programming Questions
•
9 months ago
Hi,
I want automate my test of processing. For this, I simulate the behaviour of the mouse and keyboard with Robot class.
The problem is that the event doesn't trigger the function mouseMoved().
- import java.awt.AWTException;
- import java.awt.Robot;
- Robot robot;
- void setup() {
- size(400, 400);
- try {
- robot = new Robot();
- }
- catch (AWTException e) {
- e.printStackTrace();
- }
- }
- void draw() {
- if (frameCount 0==0){
- robot.mouseMove(100, 100);
- println("fin draw");
- }
- }
- void mouseMoved(){
- println("mouve OK");
- }
there is an other way to automate test ?
1