Created
May 27, 2016 08:54
-
-
Save ruimo/57a3616b67c692adcac18156a2faab12 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.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