first working version
This commit is contained in:
commit
c44e184480
100
pom.xml
Normal file
100
pom.xml
Normal file
@ -0,0 +1,100 @@
|
|||||||
|
<project
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
|
||||||
|
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<groupId>de.lusiardi</groupId>
|
||||||
|
<artifactId>MouseMover</artifactId>
|
||||||
|
<version>0.0.1</version>
|
||||||
|
<pluginRepositories>
|
||||||
|
<pluginRepository>
|
||||||
|
<id>launch4j-xml-plugin-repo</id>
|
||||||
|
<name>launch4j-xml-plugin Repository for Maven</name>
|
||||||
|
<url>https://launch4j-xml-plugin.googlecode.com/svn/repo</url>
|
||||||
|
</pluginRepository>
|
||||||
|
</pluginRepositories>
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-shade-plugin</artifactId>
|
||||||
|
<version>1.3.1</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<phase>package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>shade</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
<configuration>
|
||||||
|
<filters>
|
||||||
|
<filter>
|
||||||
|
<artifact>*:*</artifact>
|
||||||
|
<excludes>
|
||||||
|
<exclude>META-INF/*.SF</exclude>
|
||||||
|
<exclude>META-INF/*.DSA</exclude>
|
||||||
|
<exclude>META-INF/*.RSA</exclude>
|
||||||
|
</excludes>
|
||||||
|
</filter>
|
||||||
|
</filters>
|
||||||
|
<transformers>
|
||||||
|
<transformer
|
||||||
|
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
|
||||||
|
<manifestEntries>
|
||||||
|
<Main-Class>de.lusiardi.mousemover.Main</Main-Class>
|
||||||
|
</manifestEntries>
|
||||||
|
</transformer>
|
||||||
|
<transformer
|
||||||
|
implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
|
||||||
|
<resource>lang/messages.properties</resource>
|
||||||
|
</transformer>
|
||||||
|
<transformer
|
||||||
|
implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
|
||||||
|
<resource>lang/messages_de.properties</resource>
|
||||||
|
</transformer>
|
||||||
|
<transformer
|
||||||
|
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
|
||||||
|
</transformers>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.bluestemsoftware.open.maven.plugin</groupId>
|
||||||
|
<artifactId>launch4j-plugin</artifactId>
|
||||||
|
<version>1.5.0.0</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>l4j-gui</id>
|
||||||
|
<phase>package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>launch4j</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<headerType>gui</headerType>
|
||||||
|
<outfile>target/MouseMover.exe</outfile>
|
||||||
|
<jar>target/MouseMover-0.0.1.jar</jar>
|
||||||
|
<errTitle>MouseMover Error</errTitle>
|
||||||
|
<icon>src/main/resources/mm.ico</icon>
|
||||||
|
<jre>
|
||||||
|
<minVersion>1.5.0</minVersion>
|
||||||
|
<maxVersion>1.6.0</maxVersion>
|
||||||
|
<initialHeapSize>128</initialHeapSize>
|
||||||
|
<maxHeapSize>1024</maxHeapSize>
|
||||||
|
</jre>
|
||||||
|
<versionInfo>
|
||||||
|
<fileVersion>1.0.0.0</fileVersion>
|
||||||
|
<txtFileVersion>1.0.0.0</txtFileVersion>
|
||||||
|
<fileDescription>Desc</fileDescription>
|
||||||
|
<copyright>C</copyright>
|
||||||
|
<productVersion>1.0.0.0</productVersion>
|
||||||
|
<txtProductVersion>1.0.0.0</txtProductVersion>
|
||||||
|
<productName>MouseMover</productName>
|
||||||
|
<internalName>MouseMover</internalName>
|
||||||
|
<originalFilename>MouseMover.exe</originalFilename>
|
||||||
|
</versionInfo>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
</project>
|
63
src/main/java/de/lusiardi/mousemover/Main.java
Normal file
63
src/main/java/de/lusiardi/mousemover/Main.java
Normal file
@ -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);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
BIN
src/main/resources/mm.ico
Normal file
BIN
src/main/resources/mm.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
Loading…
Reference in New Issue
Block a user