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

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

Open
psprint opened this issue Dec 13, 2020 · 3 comments
Open

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

psprint opened this issue Dec 13, 2020 · 3 comments

Comments

@psprint
Copy link

psprint commented Dec 13, 2020

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:

  • catch a global key binding, say C-M-j,
  • redirect it to an unfocused application (i.e.: Sublime Text editor) …
  • … so that the application can then request the focus (i.e.: activate itself) and perform other actions at its will,

?

@Lenbok
Copy link
Contributor

Lenbok commented Dec 13, 2020

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
Copy link

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
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants