9

This question already has an answer here:

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

marked as duplicate by Gilles linux Nov 16 '14 at 23:16

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 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 Nov 16 '14 at 23:18
0

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.

  • 7
    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 Nov 16 '14 at 23:17
-1

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...

  • cat will not see XF86Mail. Does it mean it’s grabbed? No. – Robert Siemer Nov 16 '14 at 14:45
  • 1
    It's a probabilistic appproach to help, not an exhaustive one. – dtrckd Nov 16 '14 at 20:34
  • This helped me find the cause of my problem. I stupidly had my function keys locked to on which prevented F11 from being pressed. Many thanks! – feargal Jan 30 '15 at 18:15

Not the answer you're looking for? Browse other questions tagged or ask your own question.