mooz / xkeysnail

Yet another keyboard remapping tool for X environment
891 stars 112 forks source link

Is it possible to passthrough a global binding to an application? #115

Open psprint opened 3 years ago

psprint commented 3 years ago

I'm trying to resolve a Sublime Text (SO) problem and I've stumbled upon xkeysnail. Would it be possible to use it for the solution? In other words, to:

?

Lenbok commented 3 years ago

You could have your global key binding either call either your own python function or launch an external script, which might for example use wmctrl to find and activate the Sublime Text editor window.

joshgoebel commented 2 years ago

Personally, this sounds out of scope to me... sounds like a great additional utility - a tiny piece of software that listened for globals and interacted with the window manager to do "things". That said though I'd be curious to see what the script looked like if anyone did this with a python function inside of xkeysnail. Honestly I'm not even sure how you'd "send a key to a specific application" (without it having focus) at all... that's higher in the stack that we're currently operating.

There are likely all sorts of things that are out of scope but probably still possible that might make sense for a Wiki or "at your own risk" type disclaimer, etc...

joshgoebel commented 2 years ago

My own issue #44 might be seen as a blueprint for one way to go about this... to have keys launch external scripts (which could do anything that's possible with an external script, find and focus a window, etc)... but the problem is at that point your outside the keymapper so I'm not sure how you'd inject the input.