Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

In short: is there (under Unity) any way to find out which application grabbed some global shortcut? I do not ask for "standard shortcuts" but for some way to get information about actual shortcuts (which app is actually keeping given key just now in my current config)

Longer story:

I have repeatable problems with managing keyboard shortcuts. At the moment:

  • Synapse sometimes (*) can't bind Win-Space as it's activation shortcut, reporting "Failed to register hotkey 'activate' with signature 'space'" (what usually means that this shortcut is already taken)

    (*) After one login it works, after another login it does not. I suspect some race between two apps…

  • F9 for some reason makes my screen slightly darker (and F9 does not reach application-level shortcuts so for example my byobu menu does not work)

I tried looking at various places, and:

  • I do not see any of those shortcuts in Keyboard settings/Shortcuts

  • I can't find them in gconf-editor (I tried searching for F9 in values in particular, nothing found)

  • I could not find them in dconf-editor (there is no search so I clicked some most obvious paths)

So my question is: is there any way to ask unity/dconf/gconf/d-bus/whatever about current global hotkeys allocation (which process is keeping which key). Or force logging those allocations to some log file. Or grep them from somewhere. Or………

share|improve this question
    
Could you clarify or define (for the purpose of this question) what is meant by global shortcut? –  user25656 Mar 7 '13 at 17:06
    
The key which I press and which causes something unrelated to the currently active window to happen. For example global shortcut Win-S opens expo view, global shortcut Alt-Tab switches windows, F12 (in my setup) opens tilda drop-down terminal etc etc. And, as I said, whenever I press F9, the screen dims, and I have no clue which app does that and why. And something sometimes grabs Win-space. And in the past I happened to see F12 taken away from tilda (luckily this problem went away). So I'd be happy to have some way to examine those keyboard allocations. –  Mekk Mar 7 '13 at 17:33
    
I think F9 might activate the widgets overlay, but it's been done time since I've been on Unity. Maybe look for that in CCSM..? –  Rasmus Dec 1 at 23:09

2 Answers 2

Now I understand what you need...

sudo apt-get install evtest

Enjoy disembowling Ubuntu USB HID events!

Warning This does not work on PS2/style keyboards... (but who uses there any more anyway?) :-)

P.S. Could you change your title into "How to dig down into / debug keyboard events?" as that would be more appropriate to the above answer...

share|improve this answer
    
Not fully solving my problem, but surely useful. Still, I am curious what is the place where those active bindings are actually kept and whether it can be introspected (gsettings are place they are read from by many apps, but not every app must use gsettings...) –  Mekk Dec 7 at 8:55
    
If you give me the output of the above command, I can help you... If you want to know why, I advise you to read: wiki.archlinux.org/index.php/Extra_keyboard_keys and then you'll appreciate it works at all!!! ;-) –  Fabby Dec 7 at 10:41
    
This article is not quite what I am asking about - I do not ask how keys are translated from physical keypresses to symbols (albeit this is also interesting and sometimes confusing). I ask simpler thing: which program actually keeps and applies global keyboard shortcuts, and whether there exist any kind of util or API which would let me introspect or trace those assignments. –  Mekk Dec 9 at 10:33
    
(when I start unity, it registers Alt-F2, Alt-F4, Win-S etc etc. when I start synapse it registers Win-space, when I start yakuake it registers F12 etc etc - two latter according to my config - but what is the place they register those keys in and how to access this place?) –  Mekk Dec 9 at 10:35
    
Oooh... Now I see... There is something called evtest but that does USB stuff only! On the other hand, that's exactly what you need if you use a laptop or a desktop without PS/2 style keyoard! –  Fabby Dec 9 at 20:18

The Ubuntu desktop is actually compiz and Unity itself is just a compiz plugin.

If you, instead, set and enable the compiz "commands" plugin and set keyboard shortcuts using ccsm where there is a conflict, ccsm should alert you to what plugin is causing the conflict and should also provide options to disable the conflicting plugin or conflicting keybinding before applying your settings.

Personally, I've also experienced difficulty setting keyboard shortcuts in 14.04+ but ever since I decided to start using the CCSM plugin instead of the keyboard shortcut settings in Unity, I have not experienced any issues whatsoever and all my shortcuts work just fine and so strongly suggest you at least check it out as an option.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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