2

I switched my keyboard layout to Polish, in which Alt_R is used to generate various non-Latin letters. Some of them are working, and some aren't:

  • Alt_R-l generates "ł", as it should
  • Alt_R-c should generate "ć" but instead starts Chromium
  • several other Alt_R key combinations also start various programs, or move the current window down by a small distance, or do nothing

Where are those functions coming from? There's nothing about it in my Settings->Keyboard dialog, or in ~/.Xmodmap - what are other places where systemwide keyboard shortcuts or other keyboard modifications might be defined? Is there an exhaustive list?

Better yet, is there a way to find out what application/system is reacting to a key combination like Alt_R-c so that I can then figure out where it keeps its keybindings?

This is on Xubuntu 20.04.3.

2
  • 1
    Check the file ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml. Commented Oct 3, 2021 at 20:21
  • Interesting, thanks! It doesn't seem to have anything relevant, but it does have a lot of keybindings that might be important next time I have a similar problem.
    – weronika
    Commented Oct 3, 2021 at 20:37

1 Answer 1

4

There's a keysym XF86LogGrabInfo which when pressed causes the X Server to print information about all the grabs in its log file (usually /var/log/Xorg.$DISPLAY.log). If you have xdotool installed, you can trigger that key with a command like

xdotool key XF86LogGrabInfo

From there you could identify the culprit X11 client. For instance, to determine which X11 client is messing with the "Space" key, I first get the keycode bound to the space keysym:

$ xkbcomp $DISPLAY - | grep SPCE
    <SPCE> = 65;
    key <SPCE> {         [           space ] };

(you can also use xev + press Space for that), then I search for it through Xorg.$DISPLAY.log:

$ awk '/registered grabs of client/{c=$0}/detail 65/{if(c)print c; c=""; print}' /var/log/Xorg.0.log
[452727.209]   Printing all registered grabs of client pid 32055 openbox --config-file /home/pi/.config/openbox/lxde-pi-rc.xml
[452727.220]     detail 65 (mask 0), modifiersDetail 8 (mask 0)
[452727.220]     detail 65 (mask 0), modifiersDetail 24 (mask 0)
[452727.220]     detail 65 (mask 0), modifiersDetail 10 (mask 0)
[452727.220]     detail 65 (mask 0), modifiersDetail 26 (mask 0)
[452727.241]     detail 65 (mask 0), modifiersDetail 12 (mask 0)
[452727.241]     detail 65 (mask 0), modifiersDetail 28 (mask 0)
[452727.241]     detail 65 (mask 0), modifiersDetail 14 (mask 0)
[452727.241]     detail 65 (mask 0), modifiersDetail 30 (mask 0)

modifiersDetail 8 is Mod1Mask aka Alt, etc.

So it's openbox which is stealing the Alt-Space key combo.


Notice that the pids and command lines of the clients are not always accurate; they're those of the processes who connected to the Xorg unix domain socket, which may no longer exist if they forked in the meanwhile and their children inherited the socket file descriptor (That's a general problem with the naive misuse of SO_PEERCRED "authentification", which is quite a long story ;-))

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .