I have built this already: https://github.com/phil294/AHK_X11
The X11 variant was fine, but Wayland support is indeed too messy, so the experimental build for that just uses uinput/evdev and ignores anything Wayland-related. I don't think there is a feasible alternative right now for tools like this, and it sucks. At this point I'm honestly mostly hoping for at-spi to rescue us. https://github.com/phil294/AHK_X11/issues/2