
Ask HN: Any good alternative to AHK? - boggydepot
Got this little AHK script that got bigger overtime. It&#x27;s a price checker tool for a game called Path of Exile:<p>https:&#x2F;&#x2F;github.com&#x2F;thirdy&#x2F;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&#x27;t want installing stuff.
5. Easy for non-programmers to contribute since it&#x27;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&#x27;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!).
======
profalseidol
I think
[jnativehook]([https://github.com/kwhat/jnativehook](https://github.com/kwhat/jnativehook)),
is one good route. Now I just have to find the right scripting language and
package java as self extracting 16mb 7zip.

``` import org.jnativehook.GlobalScreen; import
org.jnativehook.NativeHookException; import
org.jnativehook.keyboard.NativeKeyEvent; import
org.jnativehook.keyboard.NativeKeyListener;

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())); }

    
    
        public static void main(String[] args) throws NativeHookException {
            GlobalScreen.registerNativeHook();
            GlobalScreen.addNativeKeyListener(new GlobalKeyListenerExample());
        }

} ```

