diff --git a/.classpath b/.classpath new file mode 100644 index 0000000..71f5fef --- /dev/null +++ b/.classpath @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.gitpod.yml b/.gitpod.yml index a248717..6f2ade5 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -1,7 +1,9 @@ +--- # List the start up tasks. Learn more https://www.gitpod.io/docs/config-start-tasks/ tasks: - init: sh ./coauthors.sh vscode: extensions: - redhat.java - - mhutchie.git-graph \ No newline at end of file + - mhutchie.git-graph + - vscjava.vscode-maven diff --git a/.project b/.project new file mode 100644 index 0000000..5498e6d --- /dev/null +++ b/.project @@ -0,0 +1,34 @@ + + + ffxivai + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.m2e.core.maven2Nature + + + + 1633395485788 + + 30 + + org.eclipse.core.resources.regexFilterMatcher + node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ + + + + diff --git a/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..f9fe345 --- /dev/null +++ b/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,4 @@ +eclipse.preferences.version=1 +encoding//src/main/java=UTF-8 +encoding//src/test/java=UTF-8 +encoding/=UTF-8 diff --git a/.settings/org.eclipse.jdt.apt.core.prefs b/.settings/org.eclipse.jdt.apt.core.prefs new file mode 100644 index 0000000..d4313d4 --- /dev/null +++ b/.settings/org.eclipse.jdt.apt.core.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.apt.aptEnabled=false diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..b11489f --- /dev/null +++ b/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,9 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore +org.eclipse.jdt.core.compiler.processAnnotations=disabled +org.eclipse.jdt.core.compiler.release=disabled +org.eclipse.jdt.core.compiler.source=1.7 diff --git a/.settings/org.eclipse.m2e.core.prefs b/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000..f897a7f --- /dev/null +++ b/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/pom.xml b/pom.xml index aea6cb0..a0f9db8 100644 --- a/pom.xml +++ b/pom.xml @@ -24,10 +24,10 @@ test - com.1stleg + com.github.kwhat jnativehook - 2.1.0 - + 2.2.0 + diff --git a/src/main/java/sig/App.java b/src/main/java/sig/App.java index a25f53d..bf15260 100644 --- a/src/main/java/sig/App.java +++ b/src/main/java/sig/App.java @@ -6,13 +6,51 @@ import java.awt.GraphicsEnvironment; import java.awt.image.BufferedImage; import java.io.IOException; +import com.github.kwhat.jnativehook.GlobalScreen; +import com.github.kwhat.jnativehook.NativeHookException; +import com.github.kwhat.jnativehook.keyboard.NativeKeyEvent; +import com.github.kwhat.jnativehook.keyboard.NativeKeyListener; + import javax.swing.JFrame; public class App{ public static double FRAMETIME=0; public static Robot r; public static JFrame f; + public static void nativeKeyPressed(NativeKeyEvent e) { + System.out.println("Key Pressed: " + NativeKeyEvent.getKeyText(e.getKeyCode())); + + if (e.getKeyCode() == NativeKeyEvent.VC_ESCAPE) { + try { + GlobalScreen.unregisterNativeHook(); + } catch (NativeHookException nativeHookException) { + nativeHookException.printStackTrace(); + } + } + } + + public static void nativeKeyReleased(NativeKeyEvent e) { + System.out.println("Key Released: " + NativeKeyEvent.getKeyText(e.getKeyCode())); + } + + public static void nativeKeyTyped(NativeKeyEvent e) { + System.out.println("Key Typed: " + e.getKeyText(e.getKeyCode())); + } + public static void main(String[] args) { + try { + GlobalScreen.registerNativeHook(); + } + catch (NativeHookException ex) { + System.err.println("There was a problem registering the native hook."); + System.err.println(ex.getMessage()); + + System.exit(1); + } + + GlobalScreen.addNativeKeyListener(new GlobalKeyListenerExample()); + + try { r = new Robot(); } catch (AWTException e) { diff --git a/target/classes/main/java/sig/App.class b/target/classes/main/java/sig/App.class deleted file mode 100644 index d255302..0000000 Binary files a/target/classes/main/java/sig/App.class and /dev/null differ diff --git a/target/classes/sig/App.class b/target/classes/sig/App.class new file mode 100644 index 0000000..532d171 Binary files /dev/null and b/target/classes/sig/App.class differ diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst index f664d41..e69de29 100644 --- a/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst +++ b/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -1 +0,0 @@ -main/java/sig/App.class diff --git a/target/test-classes/sig/AppTest.class b/target/test-classes/sig/AppTest.class index 779c0f9..b212b59 100644 Binary files a/target/test-classes/sig/AppTest.class and b/target/test-classes/sig/AppTest.class differ