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

XKB overlays are missing. #124

Open
AlbertoGP opened this issue Nov 15, 2019 · 2 comments · May be fixed by #514
Open

XKB overlays are missing. #124

AlbertoGP opened this issue Nov 15, 2019 · 2 comments · May be fixed by #514
Labels
help wanted Indicates that a maintainer wants help on an issue or pull request X11 legacy: missing feature Indicates a need to implement legacy X11 features

Comments

@AlbertoGP
Copy link

AlbertoGP commented Nov 15, 2019

Hi, I know that overlays are purposely left out as mentioned in (libxkbcommon/doc/compat.md, and this comment in #18.

Well, I do use them extensively, which is a problem as I’m trying to switch to Wayland.
I use only one of the two overlays supported by XKB, but going from zero to one makes a big difference. It allows me to have features normally only available on programmable keyboards with any keyboard while using Linux.

I’m ready to work on a patch, but I’ll need at least some hints about where in the codebase to put the code.

I found HandleSetLockControls(...) in xkbcomp/action.c, and translate_controls_mask(...) in x11/keymap.c which says /* Some controls are not supported and don't appear here. */.

I suppose I would have to define a constant CONTROL_OVERLAY in src/keymap.h and add it to translate_controls_maks(...). Is that correct?

Where would the overlay key remapping be handled?

@bluetech
Copy link
Member

bluetech commented Nov 18, 2019

Overlays are cool (would be interesting to see your keymap using them!).

They were quite a complex feature, and did not see enough use to pull their weight, so we removed them in xkbcommon. If you provide a patch, we'll certainly consider it, though we can't guarantee we'll accept it.

I’ll need at least some hints about where in the codebase to put the code.

xkbcommon is directly derived from xkbcomp and the XKB code in the xserver. So you can basically see how overlays are implemented there. I have never investigated them much myself.

One issue you'll eventually hit, as you found out, is that overlays use "controls" -- these are separate parts of the XKB state, like depressed/latched/locked modifeirs/layouts. Activating an overlay toggles a bit in the controls state. The problem is that in xkbcommon this state component went entirely unused, so was removed from the API (e.g. the xkb_state_component enum and state serialization functions). I suppose you can ignore this problem to start out with.

@wismill wismill added X11 legacy: missing feature Indicates a need to implement legacy X11 features help wanted Indicates that a maintainer wants help on an issue or pull request labels May 15, 2023
@wismill wismill linked a pull request Sep 25, 2024 that will close this issue
@wismill
Copy link
Member

wismill commented Sep 25, 2024

I have a draft PR, see #514. I do not see much issue with controls, but rather find it difficult to not mess with keycode redirections, or rather: not make it complicated to use for compositors. It requires extreme rigor to redirect keycode at this level.

However, permanent overlays could be completely internal (just copy the target key) and thus make it easy to permute keys in XKB.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Indicates that a maintainer wants help on an issue or pull request X11 legacy: missing feature Indicates a need to implement legacy X11 features
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants