Let me describe you my use case and workflow. It works within the Wine bottle. My AHK setup is IIRC 1:1 from Windows and does check for window titles, I did not verify it works on Linux applications (I do need to verify this given the IIRC). So what I have is I run WoW within Wine, and then I run within the same Wine bottle AHK (I use repeater features so I don't have to mash buttons ie. not for botting). Unfortunately the latency feels noticeably worse and it also feels I have lower FPS than native Windows plus WoW plus AHK so I run it now in Proxmox + Windows + AHK as passthrough. For WoW addons I use a CLI Python tool called CurseBreaker which uses Curseforge API though Curse got sold to Overwolf and they are closing the API to push their proprietary app (in past, Curse would work in Wine I suppose Overwolf would, too). I also use FirefoxPWA to run Netflix/Prime/Disney+ on Windows which should work on Linux as well. I might retry how the latency is. Cause I do prefer a Linux desktop like Sway or Gnome over Windows though with Powertoys, Windows Terminal, Scoop, and perhaps your tool etc it becomes bearable. (I use macOS as daily driver.) FWIW, I adapted my AHK script to FFXIV which I recently started playing and on Proxmox + Windows it works. No idea if and how well (latency) it would work on native Windows or native Linux.
The killer for me is if/when my mouse doesn't work well enough or latency spikes if video card, so I ended up for the Proxmox setup to use PCIe Aorus NVMe card with two NVMe in RAID0 instead of SATA or PCIe. Now it works reasonably well. I think its related to my board having 20 PCIe lanes, 16 of which used for GPU. But we've come a long way I/O wise for PC (x86-32).
On another note, Blizzard might ban me for Proxmox usage since they changed policy when GeForce Now became a thing (they never did for AHK and I used it for about 10 years now, some of which I played the game intensive but they did do banwaves). Who knows what Square Enix policy is going to be. If they ban me I will appeal, tell them my setup, show them my script, and that I have a swollen nerve on my hand (work related injury). If a human reads it and believes me, at least they'll shake tbeir head concerning their policy. Or so I hope.
On macOS I use Hammerspoon and Karabiner Elements but that machine isn't used for gaming. Similar tools, different purpose. Though I do always rebind caps lock...
Am curious now how well that works via xrdp then as xkeysnail & other uinput methods don’t.