commit c44e1844802f949c1e4d8210170027c0f1c472b7 Author: joachim Date: Mon Jul 1 07:16:52 2013 +0200 first working version diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..b47a976 --- /dev/null +++ b/pom.xml @@ -0,0 +1,100 @@ + + 4.0.0 + de.lusiardi + MouseMover + 0.0.1 + + + launch4j-xml-plugin-repo + launch4j-xml-plugin Repository for Maven + https://launch4j-xml-plugin.googlecode.com/svn/repo + + + + + + org.apache.maven.plugins + maven-shade-plugin + 1.3.1 + + + package + + shade + + + + + + + *:* + + META-INF/*.SF + META-INF/*.DSA + META-INF/*.RSA + + + + + + + de.lusiardi.mousemover.Main + + + + lang/messages.properties + + + lang/messages_de.properties + + + + + + + org.bluestemsoftware.open.maven.plugin + launch4j-plugin + 1.5.0.0 + + + l4j-gui + package + + launch4j + + + gui + target/MouseMover.exe + target/MouseMover-0.0.1.jar + MouseMover Error + src/main/resources/mm.ico + + 1.5.0 + 1.6.0 + 128 + 1024 + + + 1.0.0.0 + 1.0.0.0 + Desc + C + 1.0.0.0 + 1.0.0.0 + MouseMover + MouseMover + MouseMover.exe + + + + + + + + diff --git a/src/main/java/de/lusiardi/mousemover/Main.java b/src/main/java/de/lusiardi/mousemover/Main.java new file mode 100644 index 0000000..c0cdb11 --- /dev/null +++ b/src/main/java/de/lusiardi/mousemover/Main.java @@ -0,0 +1,63 @@ +package de.lusiardi.mousemover; + +import java.awt.AWTException; +import java.awt.Robot; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.KeyEvent; + +import javax.swing.JButton; +import javax.swing.JFrame; + +public class Main { + private static boolean running = false; + private static Thread t = null; + + public static void main(String[] args) throws AWTException, + InterruptedException { + JFrame main = new JFrame("ScreenSaverDisabler"); + final JButton startStop = new JButton("Start"); + startStop.addActionListener(new ActionListener() { + + public void actionPerformed(ActionEvent e) { + if (running) { + running = false; + startStop.setText("Start"); + } else { + running = true; + startStop.setText("Stop"); + Runnable r = new Runnable() { + + public void run() { + Robot r = null; + try { + r = new Robot(); + } catch (AWTException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + while (running == true) { + r.keyPress(KeyEvent.VK_CONTROL); + r.keyRelease(KeyEvent.VK_CONTROL); + try { + Thread.sleep(10000); + } catch (InterruptedException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + } + }; + t = new Thread(r); + t.start(); + } + + } + }); + main.add(startStop); + main.pack(); + main.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + main.setVisible(true); + + } +} diff --git a/src/main/resources/mm.ico b/src/main/resources/mm.ico new file mode 100644 index 0000000..5d7e94d Binary files /dev/null and b/src/main/resources/mm.ico differ