【发布时间】:2016-05-09 19:01:31
【问题描述】:
如果您按住左键然后释放时停止,有没有办法让机器人自动点击?这是我目前所拥有的......这是行不通的。
public void nativeMousePressed(NativeMouseEvent e) {
if (!disable) {
if (e.getButton() == MouseEvent.BUTTON1) {
if (!randomCPS) {
robotClick(cps, typeOfClick);
} else if (randomCPS) {
robotRandomizedBetweenClicks(fromCPS, toCPS, typeOfClick);
}
}
}
}
public void nativeMouseReleased(NativeMouseEvent e) {
if (e.getButton() == MouseEvent.BUTTON1) {
disable = true;
running = false;
}
}
【问题讨论】:
-
你能展示你的
main方法吗?
标签: java mouseevent awtrobot