Show HN: AutoHotkey for Linux (opens in a new tab)github.com
500 pointsthis is the first functional reimplementation of AutoHotkey [1] for Unix-like systems, as far as I am aware. Half the commands are still missing, but everything important is done, as I have worked a lot on it over the past two months. Converting scripts into stand alone binaries is also supported. Hope this will find some adoption eventually. :-) - This implementation focuses on v1.0-like classic syntax from 2004 (!). This is a significant subset of the popular current v1.1 syntax from Windows (AHK_L). The reason this does not (yet?) target the full Windows spec is how complex it is. Notably, there's also another ongoing project which targets v2 called KeySharp [2].
If you are not aware of what AHK is, it is an easy but capable scripting language for automation and Hotkeys, and all sorts of visual things like GUIs.
If you want to learn more, there plenty of info on the repo, the docs html, and there's an active AHK Discord too, and I am personally also checking the forums and HN of course.
[1] https://www.autohotkey.com/
[2] https://bitbucket.org/mfeemster/keysharp/
Comments (183) 43 threads
Earlier commentsYou can compile it into a binary with no dependencies, so you can easily bring your script to other computers or share it. You can create a GUI to run commands rather than binding them to key patterns.
I used to use it in World of Warcraft to do things like have my character's entire skill rotation on one key (e.g. just keep pressing "1" and AHK will handle pressing the next "real" key for the sequence. Hit another key and I can reset the sequence early). And to automatically tatget myself and cast a heal when my health goes below 50%, which was done by polling a certain pixel on the screen for a specific value of red.
I actually had a way more advanced, but very buggy script I used for "multi boxing", which is when you pay for multiple accounts and play them simultaneously. I used WASD, TFGH, IJKL, for moving 3 characters simultaneously, the numpad for targeting, and ctrl/shift/alt + number-row for casting spells on any of the windows. So ctrl+2 would cast the warrior 2nd ability, shift+alt+4 would cast the druid and mage 4th ability, ctrl+shift+alt+2 would cast all character's 2nd ability, etc.
Blizzard used to be a lot more lax about macros[0], and they liked multiboxing because it was more money. I had a GM message me once to confirm I was playing all 3 and not afk botting. We chatted about AHK and how he wanted to learn to code.
[0] also the tools to detect macros were way worse back then, it might have been that they just accepted it rather than actually embracing it.
A dedicated language is nice because the syntax can be optimized for its purpose. As a teen with little coding experience, AHK was so easy to get simple ideas working. Often one easy line of code.
Some of the bigger monstrosities I wrote would have definitely been more manageable in another language, but then I'd have to handle always-active input listening, window management, emulating the keyboard and cursor, reading screen pixels, my own state machine for key chording, and so on. Or cobble together libraries (and still learn those).
Also probably the most important part, it was fun to work with and immediate. I wasn't a professional (or even good) programmer. But I had a goal in mind and AHK never made me want to quit.
Continue this thread — 1 reply
(Never used AHK myself but the couple times I looked for something similar to BetterTouchTool on Windows I got recommended AHK)
[1] Including support for all buttons on n-button mice for all values of n supported by USB standards, something that, last I checked, Windows itself was incapable of handling at the driver level without dropping down to low-level HID event processing that's a bit of a stretch, though not technically impossible, for AHK.
This, incidentally, is why many-buttoned Logitech gaming mice come preconfigured to send keyboard events for all but the first few buttons.
[1]https://github.com/yqrashawn/GokuRakuJoudo
All comments shown.
Couldn't load more comments. Check your connection and try again.