Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotstrings and non-grabbing Hotkeys don't work in some applications #1

Closed
phil294 opened this issue Aug 30, 2022 · 7 comments
Closed
Labels
bug Something isn't working

Comments

@phil294
Copy link
Owner

phil294 commented Aug 30, 2022

such as in many (all?) Gtk-based apps. :-(

The exact same problem is described here: https://stackoverflow.com/a/22773051/3779853
See

It's not reliable but most of the time it works [...] You may investigate why it does fail sometimes

the same code logic is present in ahk_x11, but I haven't been able to figure out the fix for it. Grabbing Hotkeys always work.

@phaleth
Copy link

phaleth commented Aug 31, 2022

So far the only place where I could see a hotstring work properly is the Brave Web Browser.

Once the hotstring is triggered in a place where it does not work the ahk script has to be reloaded.

4hkj9k78gf8

@phil294
Copy link
Owner Author

phil294 commented Aug 31, 2022

so apparently this is fixable by using recordlib from libxtst, sample implementation from espanso here.

As always with X11, it's a PITA. How people work with this stuff is beyond me, the docs and api are apparently not designed to be consumed by human beings, so I just can't be bothered right now. But eventually...

Luckily, espanso seems to have mastered Hotstring-like functionality perfectly on both X11 and Wayland (without sudo rights?!), so it seems we can borrow large chunks of code from there.

@phaleth
Copy link

phaleth commented Aug 31, 2022

so apparently this is fixable by using recordlib from libxtst, sample implementation from espanso here.

Nice find. I stumbled upon the mention of espanso on the hacker news thread, today.

@phil294 phil294 added the bug Something isn't working label Sep 2, 2022
@phil294
Copy link
Owner Author

phil294 commented Sep 20, 2022

good news, it works perfectly with recordlib (1, 2). Hopefully this is indeed installed on every common x11 system, but it looks like it.

I'll probably add LButton/RButton and a up:: support next, and then make a new release in a few days to weeks.

@phaleth
Copy link

phaleth commented Sep 21, 2022

good news, it works perfectly with recordlib (1, 2). Hopefully this is indeed installed on every common x11 system, but it looks like it.

That's great news!

I'm on MATE desktop. Will see how hotstrings work after the release for sure.

@phil294
Copy link
Owner Author

phil294 commented Oct 1, 2022

It's released now: https://github.com/phil294/AHK_X11/releases/tag/0.2.0

Should you encounter any issues, feel free to post them here (or open up a new issue).

@phaleth
Copy link

phaleth commented Oct 2, 2022

It's flawless 🎉

z897io89l47j

Thank you!

I guess I should try writing an ahk script. Seems like the 0.2.0 version is capable enough for at least one use case I can think of right now. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants