17

Is there an application to know which key is bound by which process and therefore not usable in another application?

keiki
  • 275
  • 2
    To see whether a key is grabbed, run the program xev from a terminal emulator, press the key while the xev window is focused, and see if a KeyPress paragraph appears in the terminal. If the key is captured (grabbed) by some application then it won't be seen by xev. – Gilles 'SO- stop being evil' Nov 16 '14 at 23:18
  • A better duplicate for this question is https://unix.stackexchange.com/questions/261371/how-do-i-find-out-what-program-owns-a-hotkey – A.P. Jun 14 '19 at 10:57

2 Answers2

0

A trick is to open a terminal and to run:

cat

Then try your shorcuts. If you see key in term then shortcut is free to use, if nothing happen, or an external event happen there is a very high probability that the shortcut isn't free...

But I still don't know global solution to globally manage shortcuts...

dtrckd
  • 244
-3

There is no competition between applications of keybindings. Either your X server catches something (in most cases your Desktop) and reactions on a key (like pressing the volume up key) or the key is passed to the current application (i.e. the one that has focus). This is different from what I remember from Windows where you could have hot-keys that went to applications that did not have focus.

So you don't need to know which Alt+somekeyis already used by some other application, you only need to know if your desktop already catches it and does something with it.

If an application needs to know about a keyboard event e.g. pressing the Forward key on a Mediakeyboard, then the Desktop should catch that event and notify the application.

Anthon
  • 79,293
  • 13
    There is competition between applications. They can’t “register” for the same hotkey. The X server doesn’t catch anything: it generates the events. The “Desktop” doesn’t exist in X11 terms: it is just a bunch of applications, some of them are X clients. With a few X server internal exceptions (e.g. terminate the X server) key events are delivered to the program that has keyboard focus unless there is a passive keyboard grab on that key!—And the most important part: if a prog wants to know about a key the “Desktop apps” should not “catch” that event, but let the prog “catch” it! – Robert Siemer Nov 16 '14 at 14:55
  • 3
    Your answer is true for keys that are used by an application when it has the focus, but not for keys grabbed by an application (which then receives it regardless of the focus). – Gilles 'SO- stop being evil' Nov 16 '14 at 23:17