|
|
|
|
@ -202,8 +202,8 @@ public abstract class JMacro {
|
|
|
|
|
* @param region 区域
|
|
|
|
|
*/
|
|
|
|
|
public void mouseLeftClick(Region region) {
|
|
|
|
|
Mouse.move(region.getCenter());
|
|
|
|
|
Mouse.at().click();
|
|
|
|
|
mouseMove(region.getCenter());
|
|
|
|
|
mouseLeftClick();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
@ -212,8 +212,8 @@ public abstract class JMacro {
|
|
|
|
|
* @param location 坐标点
|
|
|
|
|
*/
|
|
|
|
|
public void mouseLeftClick(Location location) {
|
|
|
|
|
Mouse.move(location);
|
|
|
|
|
Mouse.at().click();
|
|
|
|
|
mouseMove(location);
|
|
|
|
|
mouseLeftClick();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
@ -227,43 +227,50 @@ public abstract class JMacro {
|
|
|
|
|
* 鼠标左键双击
|
|
|
|
|
*/
|
|
|
|
|
public void mouseLeftDoubleClick(Region region) {
|
|
|
|
|
Mouse.move(region.getCenter());
|
|
|
|
|
Mouse.at().doubleClick();
|
|
|
|
|
mouseMove(region.getCenter());
|
|
|
|
|
mouseLeftDoubleClick();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 鼠标左键双击
|
|
|
|
|
*/
|
|
|
|
|
public void mouseLeftDoubleClick(Location location) {
|
|
|
|
|
Mouse.move(location);
|
|
|
|
|
Mouse.at().doubleClick();
|
|
|
|
|
mouseMove(location);
|
|
|
|
|
mouseLeftDoubleClick();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 鼠标右键单击
|
|
|
|
|
*
|
|
|
|
|
* @param region 区域
|
|
|
|
|
*/
|
|
|
|
|
public void mouseRightClick(Region region) {
|
|
|
|
|
region.getCenter().rightClick();
|
|
|
|
|
public void mouseRightClick() {
|
|
|
|
|
mouseRightClick(Mouse.at());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 鼠标右键单击
|
|
|
|
|
*
|
|
|
|
|
* @param location 坐标点
|
|
|
|
|
* @param region 区域
|
|
|
|
|
*/
|
|
|
|
|
public void mouseRightClick(Location location) {
|
|
|
|
|
location.rightClick();
|
|
|
|
|
public void mouseRightClick(Region region) {
|
|
|
|
|
// 随机移动到区域中心附近(而非直接移动到中心)
|
|
|
|
|
Location center = region.getCenter();
|
|
|
|
|
// 得到随机移动到区域中心附近的半径
|
|
|
|
|
int radius = (int) (Math.min(region.getW(), region.getH()) / 2 * 0.9f);
|
|
|
|
|
int x = center.getX() + RandomUtil.randomInt(-radius, radius);
|
|
|
|
|
int y = center.getY() + RandomUtil.randomInt(-radius, radius);
|
|
|
|
|
mouseMove(new Location(x, y));
|
|
|
|
|
mouseRightClick();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 鼠标右键单击
|
|
|
|
|
*
|
|
|
|
|
* @param location 坐标点
|
|
|
|
|
*/
|
|
|
|
|
public void mouseRightClick() {
|
|
|
|
|
mouseRightClick(Mouse.at());
|
|
|
|
|
public void mouseRightClick(Location location) {
|
|
|
|
|
mouseMove(location);
|
|
|
|
|
mouseRightClick();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 插入剪贴板
|
|
|
|
|
*/
|
|
|
|
|
|