#xkbcommon

Felix Palmen :freebsd: :c64:zirias@bsd.cafe
2024-06-17

@0x1eef @spnw Of course it has some dependencies ... didn't document anything yet, as it's still just experimentation. Isn't there some *more* output? It should really tell which package is missing.

Anyways, currently it needs (all listed in src/bin/xmoji/xmoji.mk):

- #xcb (with -cursor, -render and -xkb modules), the X11 protocol bindings
- #xkbcommon to maintain and use keyboard state
- #poser for the main event loop and a thread pool
- #fontconfig to find installed fonts by search patterns
- #harfbuzz to "shape" some text
- #freetype to load fonts, access and rasterize glyphs

Felix Palmen :freebsd: :c64:zirias@bsd.cafe
2024-05-31

@thomasadam #xkbcommon is really helpful. Was quite easy to integrate so I can fire my own "keypress" events "enriched" with the correct #X11 keysym (minus control translation, which IMHO isn't all too helpful anyways) plus a set of currently effective modifiers.
github.com/Zirias/xmoji/commit

No compose processing yet, I assume this should better be done per window... (?)

A potential issue I see is that xkbcommon uses #xcb reply functions in some places. It won't break my scheme as long as I only call xkbcommon functions from within my own event/reply handling code, but it *could* in the worst case block for a short time 😕 (possibly when the keyboard mapping is changed)

Felix Palmen :freebsd: :c64:zirias@bsd.cafe
2024-05-30

Digging a bit deeper, I now figured core #X11 won't help me getting compose-key sequences right? I guess I will need #xkb for this?

Asking experts again to correct me if I'm wrong please ... @thomasadam 😂

Well if that's the case, #xcb offers xkb of course, but it's a damn complex thing. I guess I'll accept yet another dependency instead: #xkbcommon 😉

Client Info

Server: https://mastodon.social
Version: 2025.04
Repository: https://github.com/cyevgeniy/lmst