Fun fact, Wayland support is the most requested feature [1] and I think it's possible, although we will need to go deeper in the stack and exploit EVDEV
A nice technical writeup! The daemon approach sounds particularly promising. Have you also thought about a Wayland protocol extension? espanso is not the only program that will want total keyboard access, and it's one of the last big obstacles for a lot of X11 users.
> Have you also thought about a Wayland protocol extension?
I honestly didn't think about that! That might be an option, perhaps when espanso becomes more well-known in the community. Before that, it's unlikely that any change I suggest will make its way into the specification :)