Got this little AHK script that got bigger overtime. It's a price checker tool for a game called Path of Exile:<p>https://github.com/thirdy/trademacro<p>Where it:<p>1. activates on clipboard copy event
2. parses clipboard data
3. do a POST request
4. web scrape the result
5. format and output into a tooltip<p>AHK is great bec:<p>1. Very easy to use, just like javascript, you only need a notepad and run it right away
2. It has solid support for defining hotkeys.
3. Easy tooltip, but it gets messy beyond simple ones.
4. Small runtime, a few megabytes. This is good since users are non-programmers who don't want installing stuff.
5. Easy for non-programmers to contribute since it's very simple for making macro scripts. Not a must, but good to have.<p>While AHK is okay, the code gets messy fast and hard to debug if you do not know all the language rules and best practices.<p>I would like to ask if there's something else I can go for? Have an easier life, statically typed, lots of compiler checks (in AHK, if you got something wrong, goodluck!).
I think [jnativehook](<a href="https://github.com/kwhat/jnativehook" rel="nofollow">https://github.com/kwhat/jnativehook</a>), is one good route. Now I just have to find the right scripting language and package java as self extracting 16mb 7zip.<p>```
import org.jnativehook.GlobalScreen;
import org.jnativehook.NativeHookException;
import org.jnativehook.keyboard.NativeKeyEvent;
import org.jnativehook.keyboard.NativeKeyListener;<p>public class GlobalKeyListenerExample implements NativeKeyListener {
public void nativeKeyPressed(NativeKeyEvent e) {}
public void nativeKeyReleased(NativeKeyEvent e) {}
public void nativeKeyTyped(NativeKeyEvent e) {
System.out.println("Key Typed: " + e.getKeyText(e.getKeyCode()));
}<p><pre><code> public static void main(String[] args) throws NativeHookException {
GlobalScreen.registerNativeHook();
GlobalScreen.addNativeKeyListener(new GlobalKeyListenerExample());
}</code></pre>
}
```