Debugging keyboard overlay+xbindkeys

Mariusz Mazur mariusz.g.mazur at gmail.com
Thu Nov 3 12:22:03 UTC 2016


Short version: using keyboard overlay to send e.g. XF86LaunchA, then
intercepting that with something like xbindkeys and launching an app
often triggers a bug which messes up the 'keycombo intercept'
mechanism in xorg.


Long version: inspired by fully programmable keyboards like the
ergodox or UHK, I've attempted to get the same functionality from
xorg. And almost succeeded.

What I did:
1. Switched the overlay key to act as a modifier.
     interpret Overlay1_Enable+AnyOfOrNone(all) {
-        action= LockControls(controls=Overlay1);
+        action= SetControls(controls=Overlay1);

2. Bound it to caps lock.
3. Defined caps+hjkl to act as arrow keys.
4. Defined caps+f to send XF86LaunchA to start a new terminal window
(among other similar shortcuts, like ones for switching virtual
desktops, but caps+f is the worst offender, so I'll focus on that).

The arrow keys thing works fine. The "launch app X" part doesn't. I've
tried various combinations of : kde4+konsole+xbindkeys and
lxde+lxterminal and it just doesn't work properly. The issues I've
seen:
- caps+f doesn't register some times; I need to mash it twice or
thrice for it to actually start a terminal
- xev says that sometimes the XF86LaunchA is not intercepted by
xbindkeys/lxde and actually arrives in xev; I'm guessing that might
have something to do with the previous issue
- sometimes a terminal starts in a weird zombie state, in which it
does not respond to keyboard and seems 'unfocused' (the cmd prompt
rectangle is not filled, even though the window is focused)
- The worst offender is my old kde4+xbindkeys combination (with up to
date xorg and kernel mind you) which very often (not always though)
blocks all keyboard input to all windows (xev shows nothing when I
press keys) until I either enter the exact key combination that caused
the issue (so usually caps+f) once or twice at which point it unlocks
the keyboard or I switch to some other tty and back again, which also
resets the problem (along with my xkb_keymap, which I then need to
reload). Ah, just figured it out. When in this 'locked' state *all* of
the keys I press end up intercepted by xbindkeys, which is why they
don't arrive in any apps.

It would seem using the overlay mechanism the way I do messes with
whatever mechanism xbindkeys/lxde use for intercepting keyboard
shortcuts. Does anybody have any suggestions on any tools/approaches I
could use to try to debug this further? Or is this mechanism something
so ancient that there's hope of getting it to work correctly?


More information about the xorg-devel mailing list