Live data from Hacker News

AutoHotKey V2 (Breaking Upgrade)

autohotkey.com

101–110 of 124 posts

Re: AutoHotKey V2 (Breaking Upgrade)

#101

Would a tool like Auto hotkey if it were implemented on Linux work with Wayland?

Some parts will work. Some parts won't. AHK lets you run arbitrary code in response to global hotkeys. There is no wayland protocol for applications to register global hotkeys for themselves. Compositors can choose to provide their own hotkey configurations, and what you can do in response to those hotkeys being pressed depends on the compositor. For example in Sway you can register hotkeys to run arbitrary executabl…

Thanks for the helpful summary. Capturing key presses could also work by talking to the kernel directly.

> There is currently no protocol, stable or unstable, for programs to implicitly grab the content of surfaces under the pointer, let alone read text of textboxes.

Yes there is, AtSpi, the accessibility protocol. But a normal window-independent `Click, X, Y` would indeed be quite important to have...

I'm wondering if there is a way to somehow get active window position, move windows around etc. using root privileges, without relying on a custom compositor extension. Could not find anything.

Re: AutoHotKey V2 (Breaking Upgrade)

#102
post #90
post #7

As someone who has been using Macs since 2006 and recently moved to Windows, I cannot recommend AHK enough.

It's one of the few things I miss from Windows as a Linux user. Some of it can be done using xdotool and other utilities, but nothing works the way AHK does.

Which is kind of astounding for an OS that is supposedly about flexibility and customization. Something like AHK should be built in to every personal computer OS, but it isn't for some reason.

Re: AutoHotKey V2 (Breaking Upgrade)

#103

Would a tool like Auto hotkey if it were implemented on Linux work with Wayland?

Some parts will work. Some parts won't. AHK lets you run arbitrary code in response to global hotkeys. There is no wayland protocol for applications to register global hotkeys for themselves. Compositors can choose to provide their own hotkey configurations, and what you can do in response to those hotkeys being pressed depends on the compositor. For example in Sway you can register hotkeys to run arbitrary executabl…

The solution seems obvious: build something like AHK into the compositor itself, since that's where all this is happening anyway. Do any compositors do that?

Re: AutoHotKey V2 (Breaking Upgrade)

#105
post #40

Earlier quoted context omitted.

I personally use AutoIt a ton as a super fast way to quickly prototype GUIs. It's basically a really simple entrypoint for WinAPI. Shameless plug: my script for emulating a trackball with your keyboard [0], and my tray app for quickly tweaking your cursor speed (usually for when I'm drawing something)[1] There are also some really useful utility apps like WhyNotWin11[2] that's made entirely using AutoIt [0] https://g…

The problem with AutoIt is it's openly hostile community. What community it does have is extremely and openly hostile towards newbies and non-programmers. To the point where browsing their forums has become a huge turn-off, and definitely has rejected folks trying to learn programming and/or AutoIt. Even experienced programmers sometimes ask "dumb" questions... and the hostility they're met with is unacceptable.

I have a mixed experience. Sometimes I got an insulting answer, and sometimes a throughout one.

My personal baseline for a toxic community is the Golang one on Stack Overflow. So far the AHK form is better.

Re: AutoHotKey V2 (Breaking Upgrade)

#106

Earlier quoted context omitted.

Some parts will work. Some parts won't. AHK lets you run arbitrary code in response to global hotkeys. There is no wayland protocol for applications to register global hotkeys for themselves. Compositors can choose to provide their own hotkey configurations, and what you can do in response to those hotkeys being pressed depends on the compositor. For example in Sway you can register hotkeys to run arbitrary executabl…

Thanks for the helpful summary. Capturing key presses could also work by talking to the kernel directly. > There is currently no protocol, stable or unstable, for programs to implicitly grab the content of surfaces under the pointer, let alone read text of textboxes. Yes there is, AtSpi, the accessibility protocol. But a normal window-independent `Click, X, Y` would indeed be quite important to have... I'm wondering…

>Yes there is, AtSpi, the accessibility protocol.

Right, "protocol" in that sentence meant "Wayland protocol". I'd forgotten about AT-SPI, and it's true that it solves that problem, though it seems that it also includes API for synthesizing input which would require the compositor to implement something.

>I'm wondering if there is a way to somehow get active window position, move windows around etc. using root privileges

Root doesn't matter, because the compositor isn't running as root either. ie being root won't give you any more privileges over it that just being the same user doesn't.

Things like "active window position", "move windows around", and even the entire concept of "windows" are internal to the compositor. Wayland only talks about surfaces; what the compositor does with those surfaces is up to the compositor. It might display them as windows, or as sides of a 3-D rotating cube, or print them through a printer. So you're not going to get that information from anywhere other than the compositor.

Re: AutoHotKey V2 (Breaking Upgrade)

#107
post #40

Earlier quoted context omitted.

The problem with AutoIt is it's openly hostile community. What community it does have is extremely and openly hostile towards newbies and non-programmers. To the point where browsing their forums has become a huge turn-off, and definitely has rejected folks trying to learn programming and/or AutoIt. Even experienced programmers sometimes ask "dumb" questions... and the hostility they're met with is unacceptable.

I have a mixed experience. Sometimes I got an insulting answer, and sometimes a throughout one. My personal baseline for a toxic community is the Golang one on Stack Overflow. So far the AHK form is better.

AHK is great from what I've seen. It's AutoIt that's the problem. AHK was originally a fork of the FOSS version of AutoIt, before AutoIt went closed and proprietary.

A lot of the toxicity on the AutoIt forum seems to come from the grossly overinflated egos of few core participants (some of which appear to be employees in some capacity). Reading through the forum, you can easily get the impression these people believe AutoIt is better than sliced bread or something... and anyone needing to ask a question is simply dumb.

It's rotten to the core. People should use AHK whenever possible.

Re: AutoHotKey V2 (Breaking Upgrade)

#108

Earlier quoted context omitted.

:) I’m kinda both proud and ashamed. I’ve also hated the ergonomics of the formula bar for years, but never tried to do anything about it. I’ll bet I find more weird corner cases with this hot key. My first attempt didn’t handle the autocomplete, and that was a big letdown until I found the workaround. I’m sure I’ll run into something else as well.

In return, as a token of my gratitude, I give you a script that allows horizontal scrolling in Excel with Shift + Mousewheel (bafflingly not a default in Excel, even though that's becoming standard almost everywhere else): ; Excel horizontal scroll with Shift + Mousewheel #IfWinActive, ahk_exe EXCEL.EXE +WheelUp:: SetScrollLockState, On SendInput {Left} SetScrollLockState, Off Return +WheelDown:: SetScrollLockState,…

I just added it. Yes, thank you, this works great.

Re: AutoHotKey V2 (Breaking Upgrade)

#110
post #51
post #4

As someone who recently dove back into AHK, I must say v2 has been fantastic! So many great quality of life improvements and overall the documentation is top notch. I cobbled together a launcher app and modal-hotkey system from scratch in a couple of afternoons of enjoyable work. If you're looking to try stuff out, having an autoreload function is a very nice addition to your script while developing. A very pragmatic…

Honestly I love the AHK documentation. Some of the scripts I use daily are in Python, and some are in AHK. The AHK documentation is much easier to follow than the Python documentation IMO.

I came here to comment the exact same thing. AHK documentation is by far the easiest to navigate and u derstand of any language I've learned to date.
Post reply on HN