Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ongoing efforts to use XmlXcb? #185

Open
lycheese opened this issue Apr 24, 2021 · 6 comments
Open

Ongoing efforts to use XmlXcb? #185

lycheese opened this issue Apr 24, 2021 · 6 comments

Comments

@lycheese
Copy link

I recently tried out stumpwm and discovered that neither ISO_Level3_Shift nor ISO_Level5_Shift work properly (which I need to for example to type a question mark; I am using the bone keyboard layout).

After a short research trip I discovered that clx does not completely implement xkeyboard and saw a point on cliki that an opportunity to contribute would be to use XmlXcb as a basis but I was unable to find any ongoing projects that I could contribute to.

Did I miss any projects? If there are currently none, any tips where I would start?

@dkochmanski
Copy link
Member

I'm not aware of any project doing that; however, we have discussed it on #clim IRC channel in the past.

The gist of the idea is that xcb project maintains a set of xml files that describe in detail X11 protocols; in principle it is possible to load these xml files and generate clx request definitions automatically (mind, that clx has a certain abstraction for working with the buffer and defining requests - you may see i.e how the render extension is implemented by hand).

So that would be basically a macro that converts something like this (this format is made up, I didn't check xcb nor clx atm):

<protocol name='keyboard'>
  <request name='do_something'>
    <arg name='param_1' type='integer_32' />
    <arg name='param_2' type='string' />
  </request>
</protocol>

Into something like

(defpackage #:clx/keyboard
  (:use #:cl #:xlib)
  (:export #:do-something))
(in-package #:clx/keyboard)

(define-extension "KEYBOARD")

(defun do-something (display arg1 arg2)
  (with-buffer-request (display display)
    (integer32 arg1)
    (string arg2)))

mind that there are probably many details that need to be worked out (you may learn them when you dig into xcb-xml format and clx abstractions).

@JMC-design
Copy link
Contributor

Unfortunately, as I've mentioned before, it is not a simple matter of changing from one format to another. Large events need to be properly supported, 64 bit fields supported(trivial, already done in my branch), support for both regular events and large events under the same event numbers. You basically need to completely change how clx handles events.
As for xkb specifically, I don't know about level 5, but you should be able to detect shift levels client side using compatibility maps. I've mentioned this before and there was no response and I've since forgotten the information as there didn't seem to be any interest.

@lycheese
Copy link
Author

@dkochmanski thank you for the example.

@JMC-design ISO_Level3_Shift -- as far as I can tell -- is its own self-inserting button in clx and allows -- like you said -- working around the problem with a compatibility map. ISO_Level5_Shift however shows up as NIL and is lost in stumpwm bindings (it still works in graphical programs though; I guess stumpwm only intercepts bindings after C-t and graphical programs just use libxkbcommon?).

Thank you both for taking the time to respond this. I will try out a few things and look into xmlxcb more. Would it be okay to ask eventual questions here or is there a better place?

@dkochmanski
Copy link
Member

dkochmanski commented Apr 27, 2021 via email

@fabian-thomas
Copy link

@lycheese Did you get any further with this? I wanna try out StumpWM but currently I can't since I can't even type simple lisp expressions into eval because my keyboard layout (neo2) has parens on a layer using ISO_Level3_Shift.

@lycheese
Copy link
Author

lycheese commented Feb 5, 2023

@fabian-thomas No, I sadly did not have the time to pursue this and had to switch to Wayland shortly after due to some new requirements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants