diff --git a/content/ucw-keymap-on-xwayland.rst b/content/ucw-keymap-on-xwayland.rst index 8ff1bca..75cdbe9 100644 --- a/content/ucw-keymap-on-xwayland.rst +++ b/content/ucw-keymap-on-xwayland.rst @@ -57,8 +57,8 @@ My custom keyboard layout? I didn't like fact that UCW layout is in fact just an overlay and not a "proper" level 3, so I started studying how to create a custom keyboard layout. -Few notable resources: `XKB page on ArchWiki`__, manpages for -`xkeyboard-config(7)`__, `setxkbmap(1)`__ and `xkbcomp(1)`__ and looking into +Few notable resources: `XKB page on ArchWiki `__, manpages for +`xkeyboard-config(7) `__, `setxkbmap(1) `__ and `xkbcomp(1) `__ and looking into ``/usr/share/X11/xkb/symbols/cz`` (found by grepping ``/usr/share/X11`` for "ucw"). @@ -66,7 +66,7 @@ Another reason for creating my own layouts is various tweaks esp. on laptop keyboards. For example, the laptop I am typing this sentence on has broken the up arrow key, so I would like to map it somewhere. I use ``xmodmap`` for that, but if this could be contained in a single layout, it would make stuff simpler -for me. (And as I will later learn, ``xmodmap`` `does not work well`__ with xkb +for me. (And as I will later learn, ``xmodmap`` `does not work well `__ with xkb layouts…) Also, I have another tweak on my keyboards: Compose key. This really calls for @@ -108,7 +108,7 @@ The readable KcCGST are what is stored in the filesystem as well as what you get from ``setxkbmap -print`` and may serve as a good starting point for tweaks. To get the complete ones one can use ``xkbcomp $DISPLAY -``. -The processing of these description is `different`__ in Xorg and in Wayland. If +The processing of these description is `different `__ in Xorg and in Wayland. If I were to bet where the bug is before digging into it, this sounds like a very likely culprit. @@ -116,7 +116,7 @@ A wild friend has appeared ========================== … and he had a problem and asked me if I would have a look into it. Apparently, -`group switching didn't work in XWayland`__. At first, I wanted to work it around +`group switching didn't work in XWayland `__. At first, I wanted to work it around by finally creating the Unified UCW keymap™, but I wanted to learn more about XKB (from TODO GUIDES), which took me quite long, again. (Studying, working, helping with camps *and* fixing layouts takes some time…) @@ -133,21 +133,21 @@ solving at that moment. I wanted to help my friend, though, so I started looking more into using Sway on another laptop and reading about internals of input system on `Peter -Hutterer's blog`__ TODO NAME SPELLING? Occasionally I would randomly google -(`with DuckDuckGo`__ :-D) for the issue with group switching, just in case… +Hutterer's blog `__ TODO NAME SPELLING? Occasionally I would randomly google +(`with DuckDuckGo `__ :-D) for the issue with group switching, just in case… The nerd snipe issue ==================== -`TODO SOMEONE`__ on GitHub found out an interesting workaround: when they +`TODO SOMEONE `__ on GitHub found out an interesting workaround: when they *disabled* the group switch, the UCW layout *started working*. Complete "huh?" moment, I knew I wanted to know more about why that worked. The -`xkeyboard-common(7) manpage`__ says about more group switching options, so I +`xkeyboard-common(7) manpage `__ says about more group switching options, so I randomly tried switching by Menu key in XWayland (using ``setxkbmap`` even though it complained and was supposed to do nothing), and ended up with *both* CapsLock and Menu adding diacritics. -After a bit of mathematic thinking (more in my `comment of the main issue`__) I +After a bit of mathematic thinking (more in my `comment of the main issue `__) I concluded that it was actually working fine, just that the ``SetGroup`` action was evaluated *twice*, which would overflow back to the first group when two layouts are set (probably the most common case). Mathematic term for this issue @@ -168,7 +168,7 @@ Learning what happens ===================== I continued reading, this time mostly `who-t's post series about custom -layouts`__, `core Wayland protocol`__ as well as the source code of various +layouts `__, `core Wayland protocol `__ as well as the source code of various tools (``xev``, ``wev``, ``xkbcli interactive-wayland`` &c.) Given that I knew very little about the inner workings of the stack, I wanted to find some code that would be run and "enhance" it with so many debug prints that I would @@ -192,7 +192,7 @@ One interesting observation is that contrary to my expectation, XWayland does not seem to use libxkbcommon (according to the ``/proc/PID/maps`` file). This can have several reasons, but its source code also contains a slightly tweaked version of (Xorg-style) xkb, which might mean I will be dealing with `the ugly -code`__ :-/ (Actually, XWayland might not process key events itself, instead +code `__ :-/ (Actually, XWayland might not process key events itself, instead just passing them to clients, but this seems inconsistent with the issue – what else would be introducing the second group switch?)