15

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

Mekk
  • 536

3 Answers3

2

Between 12.10 and 17.04 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 CCSS 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.

Pablo Bianchi
  • 17,371
mchid
  • 44,904
  • 8
  • 102
  • 162
1

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?) :-)

Fabby
  • 35,017
1

From one of my older answers:

First you have to install xdotool:

sudo apt-get install xdotool

I made up a series of commands to show us the passive grabs on a keystroke. For example to see what is grabbing the Shift+PrintScreen combo, you can use the below "script":

xdotool keydown "shift+Print"; xdotool key "XF86LogGrabInfo"; xdotool keyup "Print"; sleep 1; xdotool keyup "shift"; tail /var/log/Xorg.0.log

This will trigger Shift+PrtSc keyevent and on a default Ubuntu install will show gnome-settings-daemon grabbing the keyboard. At least this worked on my older 12.04 install, but looks like on a 14.04 I had to use this:

xdotool key "shift+Print"; sleep 1; xdotool key "XF86LogGrabInfo"; xdotool keyup "Print"; sleep 1; xdotool keyup "shift"; tail /var/log/Xorg.0.log

but

xdotool keydown "F12"; xdotool key "XF86LogGrabInfo"; xdotool keyup "F12"; tail /var/log/Xorg.0.log

still works, sometimes, and not other times. Don't know why.

You just have to modify the above "script" by changing the keys which have to be simulated.

falconer
  • 15,334