[b]1. Robot
Robot 类可以帮我模拟鼠标事件。[/b]
2.
3.
4.
...
Robot 类可以帮我模拟鼠标事件。[/b]
package com.java.awt;
//import java.awt.Color;
//import java.awt.Robot;
//import java.awt.event.InputEvent;
//import java.awt.event.KeyEvent;
public class MyRobot {
public static void main(String[] args) throws Exception{
// Robot robot = new Robot();
// robot.mouseMove(500, 5);
// for(;;){
// robot.mousePress(InputEvent.BUTTON1_MASK);
// robot.mouseRelease(InputEvent.BUTTON1_MASK);
// robot.mousePress(InputEvent.BUTTON1_MASK);
// robot.mouseRelease(InputEvent.BUTTON1_MASK);
// Thread.sleep(2000);
// }
// robot.keyPress(KeyEvent.VK_CONTROL);
// robot.keyPress(KeyEvent.VK_SLASH);
// robot.keyRelease(KeyEvent.VK_CONTROL);
// robot.keyRelease(KeyEvent.VK_SLASH);
// robot.keyPress(KeyEvent.VK_SHIFT);
// robot.keyPress(KeyEvent.VK_Q);
// robot.keyRelease(KeyEvent.VK_SHIFT);
// Color color = robot.getPixelColor(50, 500);
// System.out.println(color);
// robot.mouseMove(500, 200);
// robot.mousePress(InputEvent.BUTTON1_MASK);
// robot.mouseRelease(InputEvent.BUTTON1_MASK);
// robot.mouseWheel(-100);
}
}
2.
3.
4.
...