espanso / espanso

Cross-platform Text Expander written in Rust

Home Page:https://espanso.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Facilitate implementation of <Alt>, <Meta> etc. keyboard triggers

smeech opened this issue · comments

We have many requests to extend Espanso triggers to keyboard combinations including <Alt> and <Meta> etc. keys.

Operating systems have their own keybinding facilities which could be linked to commands such as espanso match exec -t <trigger>, but Espanso attempts to delete the trigger phrase, which doesn't exist when called in this manner, and therefore deletes the preceding text instead.

Currently, the best workaround I have found is to bind a key combination to a command using an external utility, e.g. xdotool sleep 0.2 type <trigger>, which invokes Espanso indirectly.

An additional parameter to espanso match exec -t which suppresses the trigger deletion, would enable anyone to link such a command to a keybinding and invoke it directly with that key-combination.

#1259, #1188, #1932,

commented

Interesting. I have Linux and xdotool, but I don't understand how to do. Maybe you are speaking of a modification of espanso code? And not about something we can do?

Yes, my idea requires modification of the codebase, but I'm hoping it's simple enough to implement.

In the meantime, you can use the xdotool command I mentioned above. Happy to help if you need it.

Yeah, would be lovely to have this instead of having one tool for alt shortcuts and another for other text application