Created
April 14, 2022 20:26
-
-
Save tinylinden/7f85affca03745a300a6b95e25593e04 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.awt.*; | |
import java.util.concurrent.Executors; | |
import java.util.concurrent.TimeUnit; | |
public class Jiggler implements Runnable { | |
private final Robot robot; | |
private Jiggler() { | |
try { | |
robot = new Robot(); | |
} catch (AWTException e) { | |
throw new IllegalStateException("Initialization failed", e); | |
} | |
} | |
@Override | |
public void run() { | |
final Point p = MouseInfo.getPointerInfo().getLocation(); | |
robot.mouseMove(p.x, p.y); | |
} | |
public static void main(String[] args) { | |
Executors.newSingleThreadScheduledExecutor() | |
.scheduleAtFixedRate(new Jiggler(), 0, 42, TimeUnit.SECONDS); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment