TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: Any good alternative to AHK?

1 点作者 boggydepot超过 8 年前
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!).

1 comment

profalseidol超过 8 年前
I think [jnativehook](<a href="https:&#x2F;&#x2F;github.com&#x2F;kwhat&#x2F;jnativehook" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;kwhat&#x2F;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(&quot;Key Typed: &quot; + e.getKeyText(e.getKeyCode())); }<p><pre><code> public static void main(String[] args) throws NativeHookException { GlobalScreen.registerNativeHook(); GlobalScreen.addNativeKeyListener(new GlobalKeyListenerExample()); }</code></pre> } ```