Skip to content

Instantly share code, notes, and snippets.

@ruimo
Created May 27, 2016 08:54
Show Gist options
  • Save ruimo/57a3616b67c692adcac18156a2faab12 to your computer and use it in GitHub Desktop.
Save ruimo/57a3616b67c692adcac18156a2faab12 to your computer and use it in GitHub Desktop.
スクリーンセーバを抑制するせこいプログラム
import java.awt.MouseInfo;
import java.awt.PointerInfo;
import java.awt.Robot;
public class Mouse {
public static void main(String... args) throws Exception {
Robot r = new Robot();
while (true) {
PointerInfo pi = MouseInfo.getPointerInfo();
r.mouseMove(pi.getLocation().x + 1, pi.getLocation().y + 1);
Thread.sleep(3 * 60 * 1000);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment